кнопка внутри MDNavigationDrawer не меняет экран при выпуске - PullRequest
1 голос
/ 01 апреля 2020

В моем MDNavigationDrawer я поместил кнопку, с которой я хочу перейти на новый экран «О нас», но при нажатии он не отвечает. Кнопка находится внутри root виджета ContentNavigationDrawer в файле .kv, и я хочу переключить экран в классе AboutUs, но он не отвечает

вот мой класс About us в файле .py

Class AboutUS(BoxLayout):
    pass

вот код в файле .kv

Screen:
    AboutUs:

    MainScreen:

    NavigationLayout:

        ScreenManager:

            Screen:

                BoxLayout:
                    orientation: 'vertical'

                    MDToolbar:
                        title: "Story A Day"
                        anchor_title: 'left'
                        elevation: 10
                        left_action_items: 
                            [['menu',lambdax:nav_drawer.set_state()]]
                        mode: "free-center"
                        right_action_items: 
                            [["jellyfish", lambda x: print('HELLOFK')]]

                    Widget:



        MDNavigationDrawer:
            title: 'Story A Day'
            id: nav_drawer
            swipe_distance: 10

            ContentNavigationDrawer:
                id: content_drawer

<ContentNavigationDrawer>
    background_color: 2, 3, 4, 5
    orientation: "vertical"
    padding: "8dp"
    spacing: "8dp"

    AnchorLayout:
        anchor_x: "right"
        size_hint_y: None
        height: avatar.height

        Image:
            id: avatar
            size_hint: None, None
            size: "56dp", "56dp"
            source: "data/logo/kivy-icon-256.png"

        MDLabel:
            anchor_y: 'left'
            text: "[b]Story A Day[/b]"
            theme_text_color: "Custom"
            text_color: 0, 0, 0, 1
            markup: True
            font_style: "H4"
            size_hint_y: None
            height: self.texture_size[1]

    MDRaisedButton:
        md_bg_color: 0, 0, 0, 1
        text: 'You Can'
        on_release: root.hllo()

    MDRaisedButton:
        text: 'Click Me'
        on_release: print('Hell')

    MDLabel: 
        text: 'Story A Day'
        font_style: "Button"
        size_hint_y: None
        height: self.texture_size[1]

    MDExpansionPanelTwoLine:
        text: 'send us your idea'
        secondary_text: 'email: xxxxx@gmail.com'

        IconLeftWidget:
            icon: "email"

    OneLineAvatarListItem:
        text: "About Us"
        on_release:
            app.current = "abt"

        IconLeftWidget:
            icon: "information"
            on_press: print('a')

    ScrollView:

<AboutUs>:
    id: manager
    name: 'abt'

    Label:
        text: "About Us"
...