问题
I'm just started to work with KivyMD. I was working on MDTabs system. I'm trying to switch tab after release button. If I try get_tab_list() func. under MDTabs(id:tabs), I get this error:
AttributeError: 'MDTabs' object has no attribute 'get_tab_list'
I can't figure it out. Please help me.
from kivy.uix.floatlayout import FloatLayout
from kivymd.app import MDApp
from kivymd.uix.tab import MDTabsBase
KV = '''
BoxLayout:
orientation: "vertical"
MDToolbar:
title: "Example Tabs"
MDTabs:
id: tabs
default_tab: 2
Tab:
text: '1'
Button:
text: 'Go Tab 3'
on_release: app.test()
Tab:
text: '2'
Tab:
text: '3'
'''
class Tab(MDTabsBase,FloatLayout):
pass
class Example(MDApp):
def build(self):
return Builder.load_string(KV)
def test(self,*args):
print('HELP :)')
Example().run()```
回答1:
Reinstall library from master branch - https://github.com/kivymd/KivyMD
来源:https://stackoverflow.com/questions/63364579/kivymd-mdtabs-cant-handle