Search code examples
pythoniosxcodekivyscale

How can I make my kivy layout the same scale on iPad and iPhone?


I have got my app working on my iPhone at a scale that looks good. I have run it now on my iPad and everything is much more spaced out and the text appears much smaller. I have had the app open on both devices and held them next to each other and it appears as though the text size is actually the same on both. Obviously it looks smaller on a bigger screen.

Another thing that is kind of strange is that on the iPad, the app screen fills the whole screen entirely, but on the iPhone, it kind of runs shy of the top and bottom by about 10% each way.

I have done a fair bit of looking around at apple's stuff and on kivy docs but can't see anything conclusive.

How may I make it so they're are automatically scaled on any iOS device? Also, how can I make the app fill out the whole screen on the iPhone? Is it something in Xcode that needs to be changed, or is it a kivy thing? I am a bit lost here. Any help will be much appreciated thank you.

EDIT: I will include a widget from one of my kivy pages, maybe the problem is in the way i'm laying it out.

BoxLayout:
    pos_hint: {"top": .9, "center_x": .5}
    size_hint: 1, .3
    size_hint_y: None
    height: 450 # set 330 for iphone
    ScrollView:
        Label:
            id: brief_res_1
            font_size: '11sp'
            do_scroll_x: True
            size_hint_y: None
            size_hint_x: None
            size: self.texture_size
            halign: "left"
            valign: "center"
            text:

Solution

  • I suggest using size_hint and pos_hint for widgets in your kv, and use the kivy.metrics (sp) for font_size.