【发布时间】:2018-12-31 23:17:33
【问题描述】:
我有我的 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
【问题讨论】:
-
澄清一下,我需要垂直列出面板项目。了解kivy的人应该知道我的意思。而不是几个 TabbedPanels 我希望 TabbedPanelItems 是垂直的
-
在这种情况下,如果代码是必要且强制性的,因为您指出: ... 面板是水平定向的。我希望这些选项卡垂直显示。我尝试过使用:`orientation:"vertical"`,也就是说,你尝试了一些看起来正确但没有成功的方法,所以如果没有代码,你的问题就跑题了:"why is这段代码不工作吗?”。总之,如果您需要帮助,请提供minimal reproducible example
-
您的代码可能不是您提出问题的必要条件,但我们需要提供合理的答案。请发帖MCVE。
-
@eyllanesc,谢谢你的信息!!
-
不,您甚至不需要代码来回答问题,但在这里我将编辑问题并显示代码