anchorlayout 中的 ScrollView。 python。基维

ScrollView in a anchorlayout. python. kivy

practice screen

这是来自 .py 文件

如您所见,屏幕由屏幕管理器控制

class Practice_Page(Screen):
    pass

class PracticeList(BoxLayout):
    def practicelist(ScrollView):

        practicelist.bind(minimum_height=layout.setter('height'))

.KV 文件:

<Practice_page>:
    canvas.before:
        Rectangle:
            pos: self.pos
            size: self.size
            source: 'background1.png'


    AnchorLayout:
        anchor_x: 'center'
        anchor_y: 'center'
        PracticeList:
            size: 900,30
            size_hint: None,None
            do_scroll_x: False        
            BoxLayout:
                orientation: 'vertical'
                padding: 10
                cols: 1
                Button:
                    text: 'The Real Number System'           
                    on_press: root.manager.current = 'open_topics'
                Button:
                    text: 'Absolute Value'
                    on_press: root.manager.current = 'open_practice'
                Button:
                    text: 'Operations W/ Integers & Fractions'           
                    on_press: root.manager.current = 'open_topics'                    
                Button:
                    text: 'Operations W/ Zero'
                    on_press: root.manager.current = 'open_formulas'

我还有大约 30 个按钮。我不知道我做错了什么,任何帮助或建议都会很有帮助。

AnchorLayout:
    anchor_x: 'center'
    anchor_y: 'center'
    ScrollView:
        #size: 900,30
        size: self.size
        #do_scroll_x: False        
        GridLayout:
           # orientation: 'vertical'
            #padding: 10
            size_hint_y: None
            height: self.minimum_height
            cols: 1
            Button:
                size_hint_y: None
                text: 'The Real Number System'           
                on_press: root.manager.current = 'open_topics'
            Button:
                size_hint_y: None
                text: 'Absolute Value'
                on_press: root.manager.current = 'open_practice'
            Button:
                size_hint_y: None
                text: 'Operations W/ Integers & Fractions'           
                on_press: root.manager.current = 'open_topics'                    
            Button:
                size_hint_y: None
                text: 'Operations W/ Zero'
                on_press: root.manager.current = 'open_formulas'

            ##MORE BTNS

对于任何需要它的人。