我在Python/Kivy中写了一些代码来显示一些内容,看来我没有把ScrollView写好。
我在程序中尝试了一些变体,但程序不显示滚动条。
这是我的代码:
def build(self):
root = BoxLayout(orientation='vertical')
box = BoxLayout(orientation='vertical')
lists = rss_feed()
for lista in lists:
temp = BoxLayout(orientation='vertical')
for entry in lista:
temp.add_widget(Label(text=entry))
box.add_widget(temp)
sv = ScrollView(size_hint=(True, True), size=(400, 400))
root.add_widget(sv)
sv.add_widget(box)
return root
我的问题是:我需要做什么来显示滚动条???
谢谢
最佳答案
我在 https://groups.google.com/forum/?fromgroups=#!topic/kivy-users/AiaUnKp3XX4 上找到了一个例子错误已被纠正。
我忘了设置绑定(bind)方法
关于python - 如何在Python/Kivy中实现ScrollView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12268140/