python - Kivy - base application has strange alignment -
i trying build basic kivy app. after adding basic elements, , running app, of elements crammed bottom left corner. shows on android , linux.
main.py:
from kivy.app import app kivy.uix.widget import widget class sublimelauncher(widget): pass class sublimelauncherapp(app): def build(self): return sublimelauncher() if __name__ == "__main__": sublimelauncherapp().run()
sublimelauncher.kv:
#:kivy 1.2.0 <sublimelauncher>: floatlayout: boxlayout: orientation: 'vertical' spacing: 10 label: text: "enter path folder open.\npress ok if open without directory" textinput: id: folderpath button: text: 'ok'
i first tried boxlayout, read somewhere root widget big app. how declare size of app? or layout? how go doing dialog box?
maybe missing basic, can't seem figure out.
edit: here seeing..
as root widget not layout (you made sublimelauncher
inherit widget
), doesn't set children size/positions. floatlayout
have defaults, since don't override them manually either.
pos: 0, 0 size: 100, 100
and these defaults of course constraints child, since floatlayout
constraint size based on size_hint property.
you want give them more space, nykakin pointed out.
also, text bigger label (you didn't set halign , text_size either) texture centered on center of label, , part of out of screen. want have @ kivy/examples/widgets/textalign.py
Comments
Post a Comment