![](/img/trans.png)
[英]How to display variable value from Python in KV file in kivy app
[英]How to display kivy panels vertically in a .kv file?
我有我的 kivy 文件和我的 python 文件。 我可以显示我的面板并在单击时显示它们的内容,但面板是水平方向的。 我希望这些选项卡垂直显示。 我试过使用
orientation: "vertical"
这不是我检查过的重复问题,但从未真正找到答案。 这是代码:
<SampBoxLayout>:
orientation: "vertical"
padding: 10
spacing: 10
BoxLayout:
orientation: "vertical"
height: 30
BoxLayout:
orientation: "vertical"
size_hint_x: .25
size_hint_y: .25
TabbedPanel:
do_default_tab: False
size: 5, 5
TabbedPanelItem:
text: "Home"
Label:
text: "Content of Home"
TabbedPanelItem:
text: "Browse"
Label:
text: "Content of Browse"
TabbedPanelItem:
text: "Radio"
Label:
text: "Content of Radio"
TabbedPanelItem:
text: "Made for You"
Label:
text: "Content of Made For You"
TabbedPanelItem:
text: "Recently Played"
Label:
text: "Content of Recently Played"
TabbedPanelItem:
text: "Favorite Songs"
Label:
text: "Content of Recent Songs"
TabbedPanelItem:
text: "Albums"
Label:
text: "Content of Albums"
TabbedPanelItem:
text: "Artists"
Label:
text: "Content of Artists"
TabbedPanelItem:
text: "Stations"
Label:
text: "Content of Stations"
TabbedPanelItem:
text: "Local Files"
Label:
text: "Content of Local Files"
TabbedPanelItem:
text: "Videos"
Label:
text: "Content of Videos"
TabbedPanelItem:
text: "Videos"
Label:
text: "Content of Videos"
TabbedPanelItem:
text: "Podcasts"
Label:
text: "Content of Podc
如果我明白您想要什么,您需要将tab_pos
属性添加到您的TabbedPanel
,例如:
TabbedPanel:
do_default_tab: False
tab_pos: 'left_top'
除非您对它们进行其他操作,否则您不需要所有这些BoxLayout
项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.