我正在学习 Kivy 图书馆,但我遇到了一些问题。我正在尝试做一个简单的换屏应用程序来做一些练习,但我认为我在这里犯了一些错误:
BoxLayout: orientation:"horizontal" size_hint:1,0.5 Label : text : "Nome :" TextInput : id : _name multiline: False Label : text : "Cognome :" TextInput : id : _surname multiline: False
代码是:
<ROT>:
FloatLayout:
AnchorLayout:
anchor_y : "top"
anchor_x: "right"
BoxLayout:
orientation : "horizontal"
spacing: 10
size_hint: 0.4,0.1
Button:
id : "_bfr"
text : "<-----"
Button:
id : "_aft"
text : "----->"
AnchorLayout :
anchor_x : "center"
anchor_y : "bottom"
ScreenManager:
size_hint_y : 0.9
id : _manager
Screen :
name : "uno"
BoxLayout :
padding :50
spacing :10
orientation : "vertical"
BoxLayout:
orientation:"horizontal"
size_hint:1,0.5
Label :
text : "Nome :"
TextInput :
id : _name
multiline: False
Label :
text : "Cognome :"
TextInput :
id : _surname
multiline: False
我希望最后写入的 boxlayout 是包含它的屏幕的 1/2。我不明白如果
大小提示
与窗口的尺寸或包含该小部件的“父”的尺寸相关联