title: Why is my Kivy AnchorLayout stuck in the bottom left?
body: <p>I have the following code in <code>my.kv</code> file:</p>
  
  <pre><code>&lt;UIWidget&gt;:
      AnchorLayout:
          anchor_x: 'right'
          anchor_y: 'top'
          Button:
              size_hint: None, None
              text: 'Build'
  </code></pre>
  
  <p>UI Widget is an empty Widget subclass.</p>
  
  <pre><code>class UIWidget(Widget):
      pass
  </code></pre>
  
  <p>My root widget loads UIWidget into itself as follows:</p>
  
  <pre><code>class SimplifiedGameWidget(Widget):
      def __init__(self, **kwargs):
          super().__init__(self, **kwargs)
          self.layout = RelativeLayout(size_hint=(None, None))
          self.layout.size = (1024, 768)
          ui_widget = UIWidget()
          ui_widget.size_hint = (1, 1)
          self.layout.add_widget(ui_widget)
          self.add_widget(self.layout)
  
   class MyApp(App):
       def build(self):
           return SimplifiedGameWidget()
  </code></pre>
  
  <p>(Full code: <a href="http://pastie.org/10791067" rel="nofollow">http://pastie.org/10791067</a>)</p>
  
  <p>What I expect to get:</p>
  
  <ul>
  <li>GameWidget > RelativeLayout > UIWidget all sized at window size</li>
  <li>The AnchorLayout that is a child of UIWidget in the top right of the screen</li>
  <li>The Button in the AnchorLayout at the default size in the top right.</li>
  </ul>
  
  <p>What I actually get:</p>
  
  <ul>
  <li>GameWidget > RelativeLayout > UIWidget all sized at window size</li>
  <li>The AnchorLayout that is a child of UIWidget in the bottom left of the screen, at 100x100px</li>
  <li>The Button in the AnchorLayout at the default size in the bottom left at 100x100px</li>
  </ul>
  
  <p>What am I doing wrong?</p>