![kv错误] [1]
这是我的主要代码,包括kv代码:
from kivy.app import App
from kivy.base import runTouchApp
from kivy.lang import Builder
from kivy.properties import ListProperty
from kivy.uix.boxlayout import BoxLayout
import time
import random
class FirstScreen(BoxLayout):
pass
class SecondScreen(BoxLayout):
pass
root_widget = Builder.load_string('''
BoxLayout:
orientation: 'vertical'
FirstScreen:
SecondScreen:
<FirstScreen>:
orientation: 'vertical'
Image:
source: 'graphics/color.png'
allow_stretch: True
keep_ratio: False
<SecondScreen>:
orientation: 'vertical'
Image:
source: 'graphics/color1.png'
allow_stretch: True
keep_ratio: False
''')
class ScreenManagerApp(App):
def build(self):
return root_widget
ScreenManagerApp().run()
我已将图像放在main.py文件所在的图形文件夹中,当我运行我的代码时,我在图像的声明源属性后得到无效数据。我已经检查了很多次,但我不明白这段代码有什么问题。