boxlayout中的滚动视图不起作用,当我运行/打开时,屏幕变黑,可能我知道代码中有什么问题。
main.py
class TransLogs(Screen):
layout = GridLayout(cols=3, spacing=10, size_hint_y=None)
layout.add_widget(Label(text='Date',size_hint_y=None,height=40))
layout.add_widget(Label(text='Operation',size_hint_y=None,height=40))
layout.add_widget(Label(text='Amount',size_hint_y=None,height=40))
cur.execute("select * from log")
f=cur.fetchall()
for i in f:
for j in i:
layout.add_widget(Label(text=str(j),size_hint_y=None,height=40))
root = ScrollView(size_hint=(1, None), size=(Window.width,
Window.height))
root.add_widget(layout)
pass