Python 带kivy的可滚动注册屏幕

Python 带kivy的可滚动注册屏幕,python,kivy,scrollview,Python,Kivy,Scrollview,我试图用kivy构建一个可滚动的注册屏幕,但我得到了这个错误:异常:“ScrollView只接受一个小部件”。拜托,我该怎么解决这个问题?我还可以得到一些关于如何允许用户在签名时上传文件的指导吗?如有其他建议,我们将不胜感激。谢谢 <SignupWindow>: first_name: first_name middle_name: middle_name last_name: last_name email2: email2 password

我试图用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"
:
名字:名字
中间名称:中间名称
姓氏:姓氏
email2:email2
密码2:密码2
职业:职业
出生:出生
滚动视图:
网格布局:
方向:“垂直”
尺寸提示:无
高度:自身最小高度
行\默认\高度:60
科尔斯:2
标签:
文本:“名字:”
尺寸提示:0.2,0.05
pos_提示:{“x”:0.25,“top”:0.9}
文本输入:
id:名字
提示文字:“名字”
多行:False
尺寸提示:0.15,0.05
pos_提示:{“x”:0.45,“top”:0.9}
标签:
文本:“中间名:”
尺寸提示:0.2,0.05
pos_提示:{“x”:0.25,“top”:0.8}
文本输入:
id:中间名
提示文字:“中间名”
多行:False
尺寸提示:0.15,0.05
pos_提示:{“x”:0.45,“top”:0.8}
标签:
文本:“姓氏:”
尺寸提示:0.2,0.05
pos_提示:{“x”:0.25,“top”:0.7}
文本输入:
id:姓
提示文字:“姓氏”
多行:False
尺寸提示:0.15,0.05
pos_提示:{“x”:0.45,“top”:0.7}
标签:
正文:“出生日期:”
尺寸提示:0.2,0.05
pos_提示:{“x”:0.25,“top”:0.6}
文本输入:
id:出生
提示文字:“mm/dd/yyyy”
多行:False
尺寸提示:0.15,0.05
pos_提示:{“x”:0.45,“top”:0.6}
标签:
文本:“电子邮件:”
尺寸提示:0.2,0.05
pos_提示:{“x”:0.25,“top”:0.5}
文本输入:
id:email2
提示文字:“email@domain.com"
多行:False
尺寸提示:0.3,0.05
pos_提示:{“x”:0.45,“top”:0.5}
标签:
文本:“密码:”
尺寸提示:0.2,0.05
pos_提示:{“x”:0.25,“top”:0.4}
文本输入:
id:密码2
提示文字:“选择密码”
多行:False
尺寸提示:0.3,0.05
pos_提示:{“x”:0.45,“top”:0.4}
标签:
文本:“密码:”
尺寸提示:0.2,0.05
pos_提示:{“x”:0.25,“top”:0.3}
文本输入:
提示文字:“再次键入密码”
多行:False
尺寸提示:0.3,0.05
pos_提示:{“x”:0.45,“top”:0.3}
标签:
正文:“职业:
尺寸提示:0.2,0.05
pos_提示:{“x”:0.25,“top”:0.2}
文本输入:
id:职业
提示文字:“职业”
多行:False
尺寸提示:0.3,0.05
pos_提示:{“x”:0.45,“top”:0.2}
按钮:
案文:“提交”
尺寸提示:0.15,0.05
pos_提示:{“x”:0.75,“top”:0.1}
新闻界:
root.signupbtn()
root.manager.transition.direction=“右”
按钮:
文本:“登录”
尺寸提示:0.15,0.05
pos_提示:{“x”:0.1,“top”:0.1}
发布时:
root.manager.current='login'
root.manager.transition.direction=“向上”

对于第一个问题,只需取消缩进
kv
中的
按钮
规则,使其不在
滚动视图
中即可


您需要单独提出其他问题,并附上一个[mcve]以显示您的尝试。

谢谢John!我工作过,我不敢相信我花了很多时间试图找到问题。