client eastwood
client eastwood

Reputation: 113

How to build Android App GUI using KV language?

I'm building a simple android App using Python Kivy, but I'm not able to make a simple GUI, what I'm trying to achieve is the following

I'm using BoxLayout, below is my KV code and the result that I got ... How can I make the TextInput above the button? Also, is there any simple Kivy GUI builder I can use?

Builder.load_string('''
<MyInterface>:
    orientation: 'vertical'

    Label:
        text: "FB"

    Label:
        TextInput:
            id: number
            size_hint_y: None
            size: (400,100)    
    IntentButton:
        size_hint_y: None
        size: (400,100)
        text: "Dial call via phone"
        on_release: self.send_sms()
    Label:

''')

class MyInterface(BoxLayout):
    pass

result: enter image description here

Upvotes: 0

Views: 154

Answers (1)

jligeza
jligeza

Reputation: 4693

Detele Label which is a parent of the TextInput.

If you add a widget to another widget, which isn't a layout, it will receive a default pos of [0, 0] and default size of [100, 100] (in your case, you have overwritten it to [400, 100]).

About a GUI designer - there is an experimental one, but it isn't recommended for beginners.

Upvotes: 2

Related Questions