KivyMD MDTabs can't handle

回眸只為那壹抹淺笑 提交于 2021-01-29 06:50:52

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!