目前这是我不可滚动的kv代码:
BoxLayout:
id: bl
orientation: 'vertical'
padding: 10, 10
row_default_height: '48dp'
row_force_default: True
spacing: 10, 10
GridLayout:
id: layout_content
cols: 1
row_default_height: '20dp'
row_force_default: True
spacing: 0, 0
padding: 0, 0
Label:
text: 'You don''t have any downloads. Please add new download from Home screen'
你如何使上面的kv代码可滚动?我知道Kivy ScrollView只接受一个子项,我已经将GridLayout作为新ScrollView的子项,但不起作用。有什么建议吗?
Traceback (most recent call last): File "main.py", line 24, in <module> edlApp().run() File "/usr/lib/python2.7/dist-packages/kivy/app.py", line 766, in run root = self.build() File "main.py", line 20, in build return Controller() File "main.py", line 16, in __init__ self.layout_content.bind(minimum_height=self.layout_content.setter('height')) AttributeError: 'NoneType' object has no attribute 'bind'
- amdScrollView:
<- 冒号要加 - Rockbotheight: self.minimum_height
。(参见https://stackoverflow.com/a/47600781/6362595) - fgoudrawidth: self.minimum_width
。 - Drake P