Kivy:无法在ScrollView中滚动

时间:2019-06-15 14:08:36

标签: python python-3.x kivy

from kivy.app import App
from kivy.uix.label import Label
from kivy.uix.textinput import TextInput
from kivy.uix.button import Button
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.scrollview import ScrollView

class APTNUApp(App):

    def build(self):
        layout = FloatLayout(size=(300, 300))


        scroll = ScrollView(size_hint=(.92, .5), pos_hint={'x': .07, 'y': .15}, do_scroll_x = False)
        my_label = TextInput(text="hi\n"*100, readonly=True)

        scroll.add_widget(my_label)
        layout.add_widget(scroll)

        return layout



APTNUApp().run()

enter image description here

如果我启动该程序,它将显示带有“ hi”的View,但是我当然不能向上或向下滚动。谁能找到根本原因?

0 个答案:

没有答案