Skip to content Skip to sidebar Skip to footer

Position Of The Kivy Label

In the same experiment, I tried to positionize a Label using this code: class TetraApp(App): def build(self): Window.size=(875,600) Window.clearcolor = (1, 1,

Solution 1:

The problem is not positioning (the BoxLyout handles that), but the size of your Label. You need to provide a height for the Label. Something like:

self.lab=Label(text="How Can I Help\n          You?", font_size='35',color =[0, 0, 0, 1], font_name='VarelaRound-Regular', size_hint_y=None, height=100)

Your TitleBar has a fixed height, the TextInput is set to take up a quarter of the BoxLayout height, and since the default size_hint_y is 1.0, your Label takes the rest of the space. Giving the Label a fixed height, leaves the rest of the space to the TextInput. You could use size_hint_y instead of the fixed height, and that would allow the Label and the TextInput to share the space proportional to their size_hint_y values.

Post a Comment for "Position Of The Kivy Label"