Table Of Contents
Stack Layout¶

New in version 1.0.5.
The StackLayout arranges children vertically or horizontally, as many as the layout can fit.
- class kivy.uix.stacklayout.StackLayout(**kwargs)[source]¶
Bases: kivy.uix.layout.Layout
Stack layout class. See module documentation for more information.
- minimum_height¶
Minimum height needed to contain all children.
New in version 1.0.8.
minimum_height is a kivy.properties.NumericProperty and defaults to 0.
- minimum_size¶
Minimum size needed to contain all children.
New in version 1.0.8.
minimum_size is a ReferenceListProperty of (minimum_width, minimum_height) properties.
- minimum_width¶
Minimum width needed to contain all children.
New in version 1.0.8.
minimum_width is a kivy.properties.NumericProperty and defaults to 0.
- orientation¶
Orientation of the layout.
orientation is an OptionProperty and defaults to ‘lr-tb’.
Valid orientations are ‘lr-tb’, ‘tb-lr’, ‘rl-tb’, ‘tb-rl’, ‘lr-bt’, ‘bt-lr’, ‘rl-bt’ and ‘bt-rl’.
Changed in version 1.5.0: orientation now correctly handles all valid combinations of ‘lr’,’rl’,’tb’,’bt’. Before this version only ‘lr-tb’ and ‘tb-lr’ were supported, and ‘tb-lr’ was misnamed and placed widgets from bottom to top and from right to left (reversed compared to what was expected).
Note
‘lr’ means Left to Right. ‘rl’ means Right to Left. ‘tb’ means Top to Bottom. ‘bt’ means Bottom to Top.
- padding¶
Padding between the layout box and it’s children: [padding_left, padding_top, padding_right, padding_bottom].
padding also accepts a two argument form [padding_horizontal, padding_vertical] and a single argument form [padding].
Changed in version 1.7.0: Replaced the NumericProperty with a VariableListProperty.
padding is a VariableListProperty and defaults to [0, 0, 0, 0].
- spacing¶
Spacing between children: [spacing_horizontal, spacing_vertical].
spacing also accepts a single argument form [spacing].
spacing is a VariableListProperty and defaults to [0, 0].