mirror of https://github.com/kivy/kivy.git
Merge branch 'master' of ssh://github.com/kivy/kivy
This commit is contained in:
commit
8a664bfc38
|
@ -2,7 +2,7 @@
|
|||
Float Layout
|
||||
============
|
||||
|
||||
The :class:`FloatLayout` class will only honor the :data:`Widget.pos_hint` and
|
||||
The :class:`FloatLayout` class honors only the :data:`Widget.pos_hint` and
|
||||
:data:`Widget.size_hint` attributes.
|
||||
|
||||
.. only:: html
|
||||
|
@ -15,18 +15,18 @@ The :class:`FloatLayout` class will only honor the :data:`Widget.pos_hint` and
|
|||
.. image:: images/floatlayout.png
|
||||
:align: right
|
||||
|
||||
For example, if you create a FloatLayout with size a of (300, 300)::
|
||||
For example, say you create a FloatLayout with a size 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::
|
||||
By default, all widgets have their size_hint=(1, 1), so this button will adopt
|
||||
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::
|
||||
To create a button 50% of the width and 25% of the height of the layout and
|
||||
positioned at (20, 20), you can do::
|
||||
|
||||
button = Button(
|
||||
text='Hello world',
|
||||
|
@ -46,8 +46,8 @@ If you want to create a button that will always be the size of layout minus
|
|||
|
||||
.. 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
|
||||
If you are not using pos_hint, you must handle the positioning of the
|
||||
children: If the float layout is moving, you must handle moving the
|
||||
children too.
|
||||
|
||||
'''
|
||||
|
|
Loading…
Reference in New Issue