使用MDToolbar的KivyMD产生错误:self._shadow = App.get_running_app()。theme_cls.quad_shadow

问题描述 投票:0回答:1

[每当我使用MDNavigationToolbar或MDToolbar小部件时,都会出现错误

message line 111, in _update_shadow
     self._shadow = App.get_running_app().theme_cls.quad_shadow

我已经阅读了很多有关此主题的信息,并按照以下示例操作:

Error: In _update_shadow self._shadow = App.get_running_app().theme_cls.quad_shadow

我完全按照步骤操作,它停止了崩溃,但是我的应用程序只有一个空白屏幕,我看不到工具栏(即使在尝试各种颜色之后)

class LoginWindow(Screen):
    pass


class CreateAccountWindow(Screen):
    pass


class QrScannerWindow(Screen):
    pass


class WindowManager(ScreenManager):
    pass


kv = Builder.load_file("mykivy.kv")
sm = WindowManager()

screens = [LoginWindow(name="login"), CreateAccountWindow(name="create account"), QrScannerWindow(name="qr scanner")]
for screen in screens:
    sm.add_widget(screen)

sm.current = "qr scanner"

class MyApp(App):
    theme_cls = ThemeManager()

    def build(self):
        return sm

kv文件:


WindowManager:
    LoginWindow:
    CreateAccountWindow:
    QrScannerWindow:

<QrScannerWindow>:
    name: "qr scanner"

    NavigationLayout:
        MDNavigationDrawer:
            NavigationDrawerToolbar:

python python-3.x kivy kivy-language
1个回答
0
投票
虽然

KivyMD

© www.soinside.com 2019 - 2024. All rights reserved.