我只能将一张图像导入 kivy,但如果我尝试导入多个图像,则会出现错误消息,“.kv 只允许一个根对象”
main.py
import kivy
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.lang import Builder
lol = Builder.load_file("my.kv")
class Myapp(App):
def build(self):
return lol
if __name__== "__main__":
Myapp().run()
我的.kv
Image:
source: 'equalizer.gif'
size_hint: 0.3, 0.4
pos_hint: {'center_x': 0.5, 'center_y': 0.5}
Image:
source: 'themp.png'
pos_hint: {'left': 1, 'top': 1}
size_hint: None, None
扬帆大鱼
相关分类