Skip to content Skip to sidebar Skip to footer

Label Not Affected By Anchorlayout - Kivy

I have just started learning kivy and am stuck with this layout problem. I used the Anchor Layout to center a button using: Button: text: 'A button' anchor_x:'center' a

Solution 1:

size_hint: 1, 1

This is your problem, the size_hint means the Label is the same size as the parent layout, with the text in the middle...i.e. the middle of the screen. It doesn't matter where the label is anchored, because there's no room for it to move.

You should instead manually set the size you want, e.g.

size_hint_y:  Noneheight: 50

Post a Comment for "Label Not Affected By Anchorlayout - Kivy"