1

I created a box layout in kivy with a few buttons and text input boxes. The boxes that I sized all get pushed to the bottom of the window with a large amount of extra padding on the top of them. How do I get rid of this padding at the top OR how do I get the window to fit to the layout exactly, without a large margin at the top?

BalanceGridLayout:
    id: Balance
    orientation: "vertical"
    display: ChekingsEntry, SavingsEntry
    padding: 10
    spacing: 10

    BoxLayout:
        size_hint_y: None
        height: "40dp"
        Label:
            text:"Chekcings"
        TextInput:
            id: ChekingsEntry
            font_size: 18
            multiline: False

     BoxLayout:
        size_hint_y: None
        height: "40dp"
        Button:
            text: "Deposite"
            size_hint_x: 15
            on_press: Balance.Deposite(0, ChekingsEntry.text)

        Button:
            text: "Withdraw"
            size_hint_x: 15
            on_press: Balance.withdraw(SavingsEntry.text)


        Button:
            text: "Transfer"
            size_hint_x: 15
            on_press: Balance.TransferIn(ChekingsEntry.text)

For reference, I was following the tutorials by Derek Banas: https://www.youtube.com/watch?v=dxXsZKmD3Kk&t=698s

The problem happened when I added:

size_hint_y: None
height: "40dp"

to each of the BoxLayouts. Previously, the elements I had would fill the entire window, but they were extremely large.

The elements he uses (buttons, text input boxes, lists etc..) stay at the top of the screen, with the sizing method, unlike mine. However, there is still a large amount of padding at the bottom of his window (example around 11:35 in the video). Is it possible to resize the window or get rid of the padding at the top?

AS Mackay
  • 2,831
  • 9
  • 19
  • 25
  • You mean, you wish to change the window size ? You can do that, see this [answer](https://stackoverflow.com/a/24997887/10826159). Or if you wanna make your widgets align in the center, you can use [Anchor Layout](https://kivy.org/doc/stable/api-kivy.uix.anchorlayout.html). – Jerome Escalante Dec 26 '18 at 15:11
  • @JeromeEscalante Yes, this helped, thanks! – Dylan Claytor Dec 27 '18 at 14:51

0 Answers0