2012-03-16 14:42:35 +00:00
Layouts
2012-04-04 19:38:00 +00:00
--------
2012-03-16 14:42:35 +00:00
2012-07-22 15:08:33 +00:00
Layouts are used to arrange widgets in a perticular manner::
2012-04-04 19:38:00 +00:00
2012-04-05 20:10:11 +00:00
AnchorLayout: widgets can be anchored to 'top', 'bottom', 'left', 'right', 'center'
2012-07-08 09:36:49 +00:00
BoxLayout: widgets are arranged in a box in either 'vertical' or 'horizontal' orientation
2012-04-04 19:38:00 +00:00
FloatLayout: Widgets are essentially unrestricted
2012-07-23 23:08:53 +00:00
RelativeLayout: Child widgets are positioned relative to the layout.
2012-07-08 09:36:49 +00:00
GridLayout: widgets are arranged in a grid defined by `rows` and `cols` properties
StackLayout: widgets are stacked in `lr-tb` (left to right then top to bottom) or `tb-lr` order
2012-04-04 19:38:00 +00:00
2012-07-08 09:36:49 +00:00
**Size_hint** : defines the size of a widget in parent space as a percentage. Values are restricted to the range 0.0 - 1.0 i.e. 0.01 = 1% and 1. = 100%.
2012-04-05 20:10:11 +00:00
**pos_hint** : is used to place the widget relative to the parent.
2012-04-04 19:38:00 +00:00
2012-07-08 09:36:49 +00:00
size_hint and pos_hint are used to calculate widget's size and position only if the value/s are not set to None.
2012-04-05 20:10:11 +00:00
However one can set these to None and provide direct values in screen coordinates.
2012-04-04 19:38:00 +00:00
2012-04-05 20:10:11 +00:00
For a detailed look at how you can arrange widgets using layouts look in
2012-07-23 23:08:53 +00:00
:mod: `AnchorLayout <kivy.uix.anchorlayout>`
:mod: `BoxLayout <kivy.uix.boxlayout>`
:mod: `FloatLayout <kivy.uix.floatlayout>`
:mod: `GridLayout <kivy.uix.gridlayout>`
:mod: `StackLayout <kivy.uix.stacklayout>`
:mod: `RelativeLayout <kivy.uix.relativelayout>`