我仍然掌握了kivy和python的特性,所以请多多包涵。我有两种布局,我的Graph布局覆盖了TopBar布局的属性。有什么办法可以解决这个问题?
这是我的.kv文件:
Root:
orientation: "vertical"
TopBar:
size_hint: 1,0.08
size_hint_max_y: 100
pos_hint: {"top":1}
TextInput:
text: "Search"
right: True
size_hint_max_x: 200
Button:
text: str(self.state)
Graph:
size_hint_max_y: 100
Button:
text: "test"
这是python文件:
class Root(BoxLayout):
def __init__(self, **kwargs):
super(Root, self).__init__(**kwargs)
class TopBar(BoxLayout):
pass
class Graph(FloatLayout):
pass
class Gui(App):
def build(self):
return Root()
Gui().run()
谢谢!