我试图用kivy构建一个可滚动的注册屏幕,但我得到了这个错误:异常:“ScrollView只接受一个小部件”。拜托,我该怎么解决这个问题?我还可以得到一些关于如何允许用户在签名时上传文件的指导吗?如有其他建议,我们将不胜感激。谢谢
<SignupWindow>:
first_name: first_name
middle_name: middle_name
last_name: last_name
email2: email2
password2: password2
profession: profession
birth: birth
ScrollView:
GridLayout:
orientation: "vertical"
size_hint_y: None
height: self.minimum_height
row_default_height: 60
cols:2
Label:
text : "First Name: "
size_hint : 0.2, 0.05
pos_hint : {"x":0.25, "top":0.9}
TextInput:
id : first_name
hint_text: "First name"
multiline : False
size_hint : 0.15, 0.05
pos_hint : {"x" : 0.45, "top" : 0.9}
Label:
text : "Middle Name: "
size_hint : 0.2, 0.05
pos_hint : {"x":0.25, "top":0.8}
TextInput:
id : middle_name
hint_text: "Middle name"
multiline : False
size_hint : 0.15, 0.05
pos_hint : {"x" : 0.45, "top" : 0.8}
Label:
text : "Last Name: "
size_hint : 0.2, 0.05
pos_hint : {"x":0.25, "top":0.7}
TextInput:
id : last_name
hint_text: "Last name"
multiline : False
size_hint : 0.15, 0.05
pos_hint : {"x" : 0.45, "top" : 0.7}
Label:
text : "Date of Birth: "
size_hint : 0.2, 0.05
pos_hint : {"x":0.25, "top":0.6}
TextInput:
id : birth
hint_text: "mm/dd/yyyy"
multiline : False
size_hint : 0.15, 0.05
pos_hint : {"x" : 0.45, "top" : 0.6}
Label:
text : "Email: "
size_hint : 0.2, 0.05
pos_hint : {"x" : 0.25, "top" : 0.5}
TextInput:
id : email2
hint_text: "email@domain.com"
multiline : False
size_hint : 0.3, 0.05
pos_hint : {"x" : 0.45, "top" : 0.5}
Label:
text : "Password: "
size_hint : 0.2, 0.05
pos_hint : {"x" : 0.25, "top" : 0.4}
TextInput:
id : password2
hint_text: "Choose a password"
multiline : False
size_hint : 0.3, 0.05
pos_hint : {"x" : 0.45, "top" : 0.4}
Label:
text : "Password: "
size_hint : 0.2, 0.05
pos_hint : {"x" : 0.25, "top" : 0.3}
TextInput:
hint_text: "Type your password again"
multiline : False
size_hint : 0.3, 0.05
pos_hint : {"x" : 0.45, "top" : 0.3}
Label:
text : "Profession: "
size_hint : 0.2, 0.05
pos_hint : {"x":0.25, "top":0.2}
TextInput:
id : profession
hint_text: "Profession"
multiline : False
size_hint : 0.3, 0.05
pos_hint : {"x" : 0.45, "top" : 0.2}
Button:
text : "Submit"
size_hint : 0.15, 0.05
pos_hint : {"x" : 0.75, "top" : 0.1}
on_press :
root.signupbtn()
root.manager.transition.direction = "right"
Button:
text : "Login"
size_hint : 0.15, 0.05
pos_hint : {"x" : 0.1, "top" : 0.1}
on_release:
root.manager.current = 'login'
root.manager.transition.direction = "up"
对于第一个问题,只需在
kv
中取消Button
规则的缩进,以便它们不在ScrollView
中您需要单独提出其他问题,并附上一个[mcve],以显示您的尝试
相关问题 更多 >
编程相关推荐