【发布时间】:2018-06-29 23:09:40
【问题描述】:
我正在尝试从一个屏幕切换到另一个屏幕。但问题是我不能在我想改变屏幕的类中调用def。
class ScreenTwo(Screen):
def remove_code(self):
main = Main_app()
self.parent.current = main.main_run()
class Main_app(Screen):
def main_run(self):
self.add_widget(Label(text="Test 1", color=(1,0,0,1), font_size=(30),size_hint=(0.4,0.15), pos_hint={"x":0.3, "top": 0.93}))
它只是将屏幕更改为 Main_App 屏幕并且不显示标签。所以它就像 ingores .main_run() 我怎样才能让它改变并显示标签?
【问题讨论】:
标签: python function class kivy