Anchor Layout¶

AnchorLayout aligns children to a border (top, bottom, left, right) or center.
To draw a button in the lower-right corner:
layout = AnchorLayout(
anchor_x='right', anchor_y='bottom')
btn = Button(text='Hello World')
layout.add_widget(btn)
- class kivy.uix.anchorlayout.AnchorLayout(**kwargs)¶
Bases: kivy.uix.layout.Layout
Anchor layout class. See module documentation for more information.
- anchor_x¶
Horizontal anchor.
anchor_x is an OptionProperty, default to ‘center’. Can take a value of ‘left’, ‘center’ or ‘right’.
- anchor_y¶
Vertical anchor.
anchor_y is an OptionProperty, default to ‘center’. Can take a value of ‘top’, ‘center’ or ‘bottom’.
- padding¶
Padding between widget box and children, in pixels.
padding is a NumericProperty, default to 0.