Layout — Kivy v1.0.1-dev documentation

# Layout

Layouts is a way to calculate and assign position of widgets. The `Layout` class itself cannot be used directly. You must use one of:

- Anchor layout : `kivy.uix.anchorlayout.AnchorLayout`
- Box layout : `kivy.uix.boxlayout.BoxLayout`
- Grid layout : `kivy.uix.gridlayout.GridLayout`
- Screen layout : `kivy.uix.screenlayout.ScreenLayout`

## Understanding size_hint property in Widget

The `size_hint` is mostly used in Layout. This is the size, in percent, not in pixels. The format is:

    widget.size_hint = (width_percent, height_percent)

The percent is between the range 0-1: 1 mean 100%.

So, if you want a widget width to be only the half of the parent, and his height to be the same as his parent, you can do:

    widget.size_hint = (0.5, 1.0)

If you don’t want to use size_hint for one of width or height, set his value to None. For example, if you want a widget width to be 250px, and his height to 30% of his parent, you can write:

    widget.size_hint = (None, 0.3)
    widget.width = 250

class `kivy.uix.layout.` `Layout`(**kwargs)

  Bases: `kivy.uix.widget.Widget`

  Layout interface class, used to implement every layout. Check module documentation for more information.

  `minimum_size`

    Minimum size required by the layout. This property is used by `Layout` to perfom his layout calculations. If the widgets size (width or height) is smaller than the minimum size, it will be resized to be at least minimum size.

    `minimum_size` is a `AliasProperty`.

  `reposition_child`(child, **kwargs)

    Force the child to be repositioned on the screen. This method is used internally in boxlayout.