当我运行下面的代码时,我无法滚动。我想滚动整个屏幕。
我怎样才能做到这一点?
from kivy.base import runTouchApp
#kivy.require("1.8.0")
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
from kivy.config import Config
from kivy.uix.scrollview import ScrollView
from kivy.properties import StringProperty
Config.set('graphics', 'window_state', 'maximized')
Builder.load_string('''
<ScrollableLabel>:
FloatLayout:
AsyncImage:
source:'' #html here
allow_stretch: True
keep_ratio: False
pos_hint: {"top": 1, 'right':1}
size_hint: 1, 1
AsyncImage:
source:'' #html here
allow_stretch: True
keep_ratio: True
pos_hint: {"top": 1, 'right':0.13}
size_hint: 0.15, 0.15
Label:
color: [66/255,134/255,244/255,1]
height: 40
font_size: 25
italic: 1
bold: 1
text: 'testing'
pos_hint: {"top": 0.96, 'right': 0.24}
size_hint: 0.1, 0.1
Label:
color: [66/255,134/255,244/255,1]
height: 40
font_size: 50
italic: 1
bold: 1
text: 'Testing\\nTesting1\\nTesting2\\nTesting3\\nTesting4'
pos: root.x, root.y+25
size_hint: 0.1, 0.1
''')
class ScrollableLabel(ScrollView):
text = StringProperty('')
if __name__ == "__main__":
runTouchApp(ScrollableLabel())
所有的东西都显示,但滚动条没有。
皈依舞
相关分类