繁体   English   中英

锚点布局中的ScrollView。 蟒蛇。 基维

[英]ScrollView in a anchorlayout. python. kivy

练习画面

这是来自.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

对于任何需要它的人。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM