是的,你可以這樣做:
在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)
你可以瀏覽一下這些文件,看看你還可以根據自己的需要做些什么改變。在