【发布时间】:2021-01-04 02:35:47
【问题描述】:
我正在使用 Kivy 构建一个登录页面,它总是说我有一个名称错误并且没有定义密码。我找到了一些教程,但它们看起来和我的一样,所以我无法找出问题所在。希望有人能帮忙。谢谢
这是我的代码:
FloatLayout:
TextInput:
id: "password"
name: "password"
multiline: False
hint_text: 'Enter Password'
hint_text_color: (1,1,1,.5)
pos_hint: {'center_y': .45, 'center_x':.5}
size_hint: .3,.1
on_text:
self.foreground_color: (1,0,0,1)
foreground_color: (1,1,1,1)
background_color: (.14,.15,.30,.5)
cursor_color: (1,1,1,1)
Button:
text:"Submit"
pos_hint: {'center_y': .3, 'center_x':.5}
size_hint: .1,.1
on_release:
app.root.current = "dashboard" if password.text == "admin" else "login"
root.manager.transition.direction = "left"
【问题讨论】:
-
请分享堆栈跟踪
标签: python authentication kivy kivy-language nameerror