【发布时间】:2018-08-14 12:18:46
【问题描述】:
我仍然掌握 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()
谢谢!
【问题讨论】:
标签: python python-3.x kivy kivy-language