python - Kivy BoxLayout - move widgets to the top -
i have widgets sized , positioned relative 1 another. if add "label:" bottom of kv code move top. can't "right" way it. missing?
import kivy kivy.require('1.9.0') kivy.app import app kivy.uix.button import button kivy.uix.textinput import textinput kivy.uix.boxlayout import boxlayout kivy.lang import builder builder.load_string(''' <controller>: boxlayout: orientation: 'vertical' padding: 20 spacing: 20 textinput: hint_text: 'feed name' multiline: false size_hint: (0.75, none) height: 30 pos_hint: {'center_x': 0.5} textinput: hint_text: 'feed url' multiline: true size_hint: (0.75, none) height: 68 pos_hint: {'center_x': 0.5} button: text: 'add feed' padding: (10, 10) height: 30 size_hint: (none, none) pos_hint: {'center_x': 0.5} ''') class controller(boxlayout): pass class podcastapp(app): def build(self): return controller(info='hello world') if __name__ == '__main__': podcastapp().run()
from boxlayout docs:
padding added in 1.0.0 padding between layout box , children: [padding_left, padding_top, padding_right, padding_bottom].
padding accepts 2 argument form [padding_horizontal, padding_vertical] , 1 argument form [padding].
changed in version 1.7.0: replaced numericproperty variablelistproperty.
padding variablelistproperty , defaults [0, 0, 0, 0].
try adding padding bottom of boxlayout if want it's children pushed toward top.
for instance giving padding value of
[20, 20, 20, 'new bottom padding here']
Comments
Post a Comment