Skip to content

Instantly share code, notes, and snippets.

@kived
Last active March 3, 2016 20:30
Show Gist options
  • Save kived/99f7ed7312015bbc1460 to your computer and use it in GitHub Desktop.
Save kived/99f7ed7312015bbc1460 to your computer and use it in GitHub Desktop.
Kivy: centered button
BoxLayout:
Widget
Button:
size_hint_x: 6 # 6/8 == 0.75
Widget
AnchorLayout:
Button:
size_hint_x: 0.75
@abhigenie92
Copy link

<LoginScreen>:
    BoxLayout:
        orientation: 'vertical'
        padding: [200,75,200,75]
        spacing: 20
        Label:
            text:"Username:"
            font_size:25
        TextInput:
            id:username 
            font_size:35
        Label:
            text:"Password:"
            font_size:25
        TextInput:
            id:password
            font_size:35
            password:True
        Button:
            text:"Login/Create Account"
            font_size:25
            bold: True
            size_hint_x: 0.75  # 6/8 == 0.75

@kived
Copy link
Author

kived commented Mar 3, 2016

<LoginScreen>:
    BoxLayout:
        orientation: 'vertical'
        padding: [200,75,200,75]
        spacing: 20
        Label:
            text:"Username:"
            font_size:25
        TextInput:
            id:username 
            font_size:35
        Label:
            text:"Password:"
            font_size:25
        TextInput:
            id:password
            font_size:35
            password:True
        BoxLayout:
            Widget
            Button:
                text:"Login/Create Account"
                font_size:25
                bold: True
                size_hint_x: 6  # 6/8 == 0.75
            Widget

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment