是的,你可以这样做:
在ScrollView中有一个scroll_类型属性,因此通过设置它,您可以实现您想要的功能。在
如果设置scroll_type=['bars'],则可能需要更改bar_width属性,因为它的默认值为2,而且它太小,无法用鼠标抓取
以下是基于文档中的示例:layout = GridLayout(cols=1, spacing=10, size_hint_y=None)
# Make sure the height is such that there is something to scroll.
layout.bind(minimum_height=layout.setter('height'))
for i in range(30):
btn = Button(text=str(i), size_hint_y=None, height=40)
layout.add_widget(btn)
root = ScrollView(size_hint=(None, None), size=(400, 400),
scroll_type=['bars'], bar_width='10dp') #you can use both ['bars','content']
root.add_widget(layout)
你可以浏览一下这些文件,看看你还可以根据自己的需要做些什么改变。在