Search code examples
pythonkivykivy-language

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 likeenter image description here

In summary the width isn't changing.

Any help would be appreciated.


Solution

  • 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