<TabbedPanelTest>:
size_hint: .5, .5
pos_hint: {'center_x': .5, 'center_y': .5}
do_default_tab: False
TabbedPanelItem:
text: 'first tab'
Label:
text: 'First tab content area'
TabbedPanelItem:
text: 'tab2'
BoxLayout:
Label:
text: 'Second tab content area'
Button:
text: 'Button that does nothing'
TabbedPanelItem:
text: 'tab3'
RstDocument:
text:
'\\n'.join(("Hello world", "-----------",
"You are in the third tab."))
from kivy.app import App
from kivy.uix.tabbedpanel import TabbedPanel
class TabbedPanelTest(TabbedPanel):
def __init__(self, **kwargs):
super().__init__(**kwargs)
class TabbedPanelApp(App):
def build(self):
return TabbedPanelTest()
if __name__ == '__main__':
from kivy.core.window import Window
Window.clearcolor = [.8,.8,.8,1]
TabbedPanelApp().run()
kivy 018 TabbedPanel
最新推荐文章于 2023-03-20 22:54:45 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)