pythonandroidlistkivyscrollview

PYTHON + KIVYMD / KIVY | Scrollview is only on half the screen but works as normal when used in a navigation drawer


Here is a picture of the problem. As you can see the left side picture has a fully working scrollview, the rightside picture on the other hand is only displaying the scrollview on the bottom half of the screen.

Not sure whats wrong here. Ive tried moving the intendent levels back and forth, for some reason it refuses to put anything above the equator enter image description here

Snippit of the KV code from the not working part:

Screen:
    container: container
    BoxLayout:
        id: container
        orientation: 'vertical'
        MDToolbar:
            title: "TRYM"
            anchor_title: "center"

         #   right_action_items: [["check", lambda x: app.show_alert_dialog_save(), 'Save']]
            left_action_items: [["keyboard-backspace", lambda x: app.show_alert_dialog_back(), 'Back']]

        Widget:

        ScreenManager:
            id: screen_manager

            Screen:
                name: 'innlogget_trym_alarm'
                id: trym
                MDBottomNavigation:

                    MDBottomNavigationItem:
                        name: 'alarm_trym'
                        text: 'Alarm'
                        icon: 'alarm'
                        on_tab_release: text: 'Alarm'
                        MDLabel:
                            text: 'Currently no alarm active'
                            pos_hint: {"center_x": .5, "center_y": .8}
                            halign: 'center'

                        MDFloatingActionButton:
                            id: trym_time_picker
                            name: 'trym'
                            icon: "alarm-plus"
                            opposite_colors: False
                            elevation_normal: 8
                            pos_hint: {"center_x": .9, "center_y": .2}
                            on_release:
                                app.show_time_picker('trym')



                    MDBottomNavigationItem:
                        name: 'instillinger_trym'
                        text: 'Instillinger'
                        icon: 'tools'
                    #    on_tab_release: screen_manager.current = "settings_list_view"
                        MDLabel:


                        ScrollView:


                            MDList:

                                OneLineIconListItem:
                                    text: "Oppgrader til premium"
                                    on_release:
                                        print("Click!")
                                    IconLeftWidget:
                                        icon: "lock-outline"

                                TwoLineIconListItem:
                                    text: "Tilkoblingsinnstillinger"
                                    secondary_text: "Endre IP og port for klientsiden"
                                    on_release:
                                        app.show_confirmation_dialog()
                                    IconLeftWidget:
                                        icon: "lan-connect"

                                TwoLineIconListItem:
                                    text: "Alarminstillinger"
                                    secondary_text: "Konfigurer forsinket eller for tidlig handling"
                                    on_release:
                                        print("Click!")
                                    IconLeftWidget:
                                        icon: "account-clock"

Snippit of the KV code from the working part:

MDNavigationDrawer:
    id: nav_draw
    orientation: "vertical"
    padding: "8dp"
    spacing: "8dp"

    AnchorLayout:
        anchor_x: "center"
        size_hint_y: None
        height: avatar.height
        Image:
            id: avatar
            size_hint: None, None
            size: "56dp", "56dp"
            source: "untitled.jpg"
    MDLabel:
        halign: 'center'
        anchor_x: "right"
        text: "AnySched"
        font_style: "Button"
        size_hint_y: None
        height: self.texture_size[1]

    MDLabel:
        text: ""
        font_style: "Caption"
        size_hint_y: None
        height: self.texture_size[1]

    ScrollView:
        MDList:

            OneLineAvatarListItem:
                on_press:
                    nav_draw.set_state("close")
                    app.next_screen('trym')


                text: "Trym"
                IconLeftWidget:
                    icon: "account-box"


            OneLineAvatarListItem:
                on_press:
                    nav_draw.set_state("close")
                    screen_manager.current = "lucas"

Solution

  • So I found the problem was caused by the Widget:
    (in case that anyone else gets the same issue)

    Screen:
        container: container
        BoxLayout:
            id: container
            orientation: 'vertical'
            MDToolbar:
                title: "TRYM"
                anchor_title: "center"
    
             #   right_action_items: [["check", lambda x: app.show_alert_dialog_save(), 'Save']]
                left_action_items: [["keyboard-backspace", lambda x: app.show_alert_dialog_back(), 'Back']]
    
             Widget: # <----- After removing this the ScrollView fills the whole screen not just half :)
    
             ScreenManager:
                 id: screen_manager
    
             Screen:
                 name: 'innlogget_trym_alarm'
                 id: trym
                 MDBottomNavigation:
                 .
                 .
                 .