简体   繁体   English

如何在kivy中将Scroll VIew应用于Box Layout

[英]How to apply Scroll VIew to Box Layout in kivy

I have lots of Button and I want to apply scrollview to Box Layout like below 我有很多按钮,我想将滚动视图应用于框布局,如下所示

<My Class>:
  ScrollView:
    BoxLayout:
      Button:
        text:"buttone1"
       Button:
        text:"buttone1"
       Button:
        text:"buttone1"
       Button:
        text:"buttone1"
       Button:
        text:"buttone1"
       Button:
        text:"buttone1"
       GridLayout:
         rows:4
         cols:4
         Button:
           text:"buttone1"
         Button:
           text:"buttone1"
         Button:
           text:"buttone1"
         Button:
           text:"buttone1"
         Button:
           text:"buttone1"

how can i Apply Scrollview to above Content 我如何将Scrollview应用于以上内容

put all the buttons and textviews inside a SINGLE layout and put that layout inside ScrollView. 将所有按钮和textviews放置在SINGLE布局中,然后将该布局放置在ScrollView中。 It should be working 应该可以

here is the simplest solution i found: 这是我发现的最简单的解决方案:

 ScrollView: GridLayout: id: glayout cols: 1 size_hint: (1, None) height: self.minimum_height Button: text:"button1" Button: text:"button2" Button: text:"button3" #Put content that you need in gridlayout 

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

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