屏幕内容重叠的Kivy中的导航抽屉

发布于 2025-02-10 16:33:00 字数 2312 浏览 2 评论 0原文

您可以看到我屏幕上的任何内容在我的导航栏上重叠 我的屏幕和导航条代码

    MDNavigationLayout:
        ScreenManager:
            Screen:
                BoxLayout:
                    orientation: "vertical"
                    MDToolbar:
                        title: "My App"
                        left_action_items: [["menu",lambda x: nav_drawer.set_state("open")]]
                        
                        right_action_items: [["login",lambda x: app.login()]]
                        elevation: 10
                    Widget:
                    MDBottomAppBar:
                        MDToolbar:
                            left_action_items: [["white-balance-sunny",lambda x: app.dark()]]
                            mode: 'end'    
                            type: 'bottom'
                            icon: 'plus'
                            on_action_button: app.new()
        MDNavigationDrawer:
            id: nav_drawer
            BoxLayout:
                orientation: 'vertical'
                spacing: '8dp'
                padding: '8dp'
                Image:
                    source: 'no_pfp.jpg'
                MDLabel:
                    text: '         Naitik'
                    font_style: 'Subtitle1'
                    size_hint_y: None
                    height: self.texture_size[1]
                MDLabel:
                    text: '            [email protected]'
                    font_style: 'Caption'
                    size_hint_y: None
                    height: self.texture_size[1]
                ScrollView:
                    MDList:
                        OneLineIconListItem:
                            text: 'Profile'
                            IconLeftWidget: 
                                icon: 'face-profile'
                        OneLineIconListItem:
                            text: 'Login'
                            IconLeftWidget: 
                                icon: 'login'

我试图将mdnavigation drawder放置在ScreenManager上方,但随后变成了透性 我能做些什么?

enter image description here

As you can see any content from my screen is overlapping on my navigation bar
My screen and nav bar code

    MDNavigationLayout:
        ScreenManager:
            Screen:
                BoxLayout:
                    orientation: "vertical"
                    MDToolbar:
                        title: "My App"
                        left_action_items: [["menu",lambda x: nav_drawer.set_state("open")]]
                        
                        right_action_items: [["login",lambda x: app.login()]]
                        elevation: 10
                    Widget:
                    MDBottomAppBar:
                        MDToolbar:
                            left_action_items: [["white-balance-sunny",lambda x: app.dark()]]
                            mode: 'end'    
                            type: 'bottom'
                            icon: 'plus'
                            on_action_button: app.new()
        MDNavigationDrawer:
            id: nav_drawer
            BoxLayout:
                orientation: 'vertical'
                spacing: '8dp'
                padding: '8dp'
                Image:
                    source: 'no_pfp.jpg'
                MDLabel:
                    text: '         Naitik'
                    font_style: 'Subtitle1'
                    size_hint_y: None
                    height: self.texture_size[1]
                MDLabel:
                    text: '            [email protected]'
                    font_style: 'Caption'
                    size_hint_y: None
                    height: self.texture_size[1]
                ScrollView:
                    MDList:
                        OneLineIconListItem:
                            text: 'Profile'
                            IconLeftWidget: 
                                icon: 'face-profile'
                        OneLineIconListItem:
                            text: 'Login'
                            IconLeftWidget: 
                                icon: 'login'

I tried to put MDNavigationDrawer and it's stuff above screenmanager but then it become transperant
What can i do?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文