如何解决带有滚动的可滚动注册屏幕
我正在尝试用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,"top":0.8}
TextInput:
id : middle_name
hint_text: "Middle name"
multiline : False
size_hint : 0.15,"top" : 0.8}
Label:
text : "Last Name: "
size_hint : 0.2,"top":0.7}
TextInput:
id : last_name
hint_text: "Last name"
multiline : False
size_hint : 0.15,"top" : 0.7}
Label:
text : "Date of Birth: "
size_hint : 0.2,"top":0.6}
TextInput:
id : birth
hint_text: "mm/dd/yyyy"
multiline : False
size_hint : 0.15,"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,"top" : 0.5}
Label:
text : "Password: "
size_hint : 0.2,"top" : 0.4}
TextInput:
id : password2
hint_text: "Choose a password"
multiline : False
size_hint : 0.3,"top" : 0.4}
Label:
text : "Password: "
size_hint : 0.2,"top" : 0.3}
TextInput:
hint_text: "Type your password again"
multiline : False
size_hint : 0.3,"top" : 0.3}
Label:
text : "Profession: "
size_hint : 0.2,"top":0.2}
TextInput:
id : profession
hint_text: "Profession"
multiline : False
size_hint : 0.3,"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"
解决方法
对于第一个问题,只需在Button
中取消kv
规则的缩进,以使它们不在ScrollView
内。
您需要单独询问其他问题,并包括一个显示您的尝试的[mcve]。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。