你好,我實際上想做的是:我想創建這個登錄屏幕,如果你有正確的郵件(在本例中只是 [email protected])從 KV 文件觸發 inapp 屏幕,這是我的實際問題。我無法觸發“inapp”屏幕我在 PY 文件中沒有屏幕管理器和屏幕類的原因是因為它有問題,當我切換屏幕時它會重疊 這是有問題的 UI 的示例在我的情況下我做錯了什么?這是我的PY 文件:class mytest(MDApp): def build(self): self.theme_cls.theme_style = "Dark" self.theme_cls.accent_palette = 'Blue' self.theme_cls.accent_hue = '300' self.theme_cls.primary_palette = "Green" self.theme_cls.primary_hue = "400" self.icon = 'testphoto.png' self.title = "coolapp" def login_checker(self, mail, psswrd): hismail = mail hispass = psswrd print(themail) print(thepass) access_screen = self.root.ids.inapp if themail == "[email protected]": print("Corect") access_screen else: toast("Invalid E-mail")
1 回答

紅顏莎娜
TA貢獻1842條經驗 獲得超13個贊
您只需訪問 即可ScreenManager設置current Screen,如下所示:
if themail == "[email protected]":
print("Corect")
self.root.ids.scrin_meneger.current = 'inapp'
else:
toast("Invalid E-mail")
添加回答
舉報
0/150
提交
取消