【发布时间】:2020-08-28 21:10:16
【问题描述】:
我正在尝试使用 python 更改 kivy 中的四个父框布局大小。
代码-
class Run_app(App):
def b1(self):
self.b1 = BoxLayout(orientation="horizontal", spacing=10, size=(1, 0.15))
#< ADDED Two to three box layouts to self.b1>
return(self.b1)
def b2(self):
self.b2 = BoxLayout(orientation="horizontal", spacing=10, size=(1, 0.45))
#< ADDED Two to three box layouts to self.b2>
return(self.b2)
def b3(self):
self.b3 = BoxLayout(orientation="horizontal", spacing=10, size=(1, 0.20))
#< ADDED Two to three box layouts to self.b3>
return(self.b3)
def b4(self):
self.b4 = BoxLayout(orientation="horizontal", spacing=10, size=(1, 0.20))
#< ADDED Two to three box layouts to self.b4>
return(self.b4)
def build(self):
self.title = "GUI"
self.root = BoxLayout(orientation="vertical", padding=15, spacing=15, )
self.root.add_widget(self.b1())
self.root.add_widget(self.b2())
self.root.add_widget(self.b3())
self.root.add_widget(self.b4())
return(self.root)
我试图改变盒子的大小(b1,b2,b3,b4),但是大小没有改变,请你解释一下如何在kivy中改变父框布局的大小,
谢谢
【问题讨论】:
标签: python kivy kivy-language