Float Layout¶
The FloatLayout class will only honor the Widget.pos_hint and Widget.size_hint attributes.

For example, if you create a FloatLayout with size a of (300, 300):
layout = FloatLayout(size=(300, 300))
By default, all widgets have size_hint=(1, 1), so this button will have the same size as the layout:
button = Button(text='Hello world')
layout.add_widget(button)
To create a button of 50% width and 25% height of the layout and positioned at (20, 20), you can do:
button = Button(
text='Hello world',
size_hint=(.5, .25),
pos=(20, 20))
If you want to create a button that will always be the size of layout minus 20% on each side:
button = Button(text='Hello world', size_hint=(.6, .6),
pos_hint={'x':.2, 'y':.2})
Note
This layout can be used for an application. Most of time, you will use the size of Window.
Warning
If you are not using pos_hint, you must handle the position of children: If the float layout is moving, you must handle moving children too.
- class kivy.uix.floatlayout.FloatLayout(**kwargs)¶
Bases: kivy.uix.layout.Layout
Float layout class. See module documentation for more information.