简体   繁体   中英

Kivy Text Input Width not changing

I'm working on a Kivy app and I have a kv file looking like this. (cutdown to only show the necessary portion)

<LoginWindow>:
    username:username
    password:password
    BoxLayout:
        canvas:
            Rectangle:
                size: self.size
                pos: self.pos
                texture: Gradient.vertical(get_color_from_hex("000000"), get_color_from_hex("000080"))
    BoxLayout:
        orientation:"vertical"
        BoxLayout:
            orientation:"vertical"
            padding_x:[50,50]
                
            TextInput:
                multiline:False
                id:username
                hint_text:"Username"
                padding:[20,20,20,20]
                width:1
        
            TextInput:
                multiline:False
                id:password
                password:True
                hint_text:"Password"
                padding_x:20

However when I change the width of the input my kivy file still looks like在此处输入图片说明

In summary the width isn't changing.

Any help would be appreciated.

TextInput:
    multiline:False
    id:username
    hint_text:"Username"
    padding:[20,20,20,20]
    size_hint: None, None
    width:1

This is the only way that I know off that might help with your problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM