Forum Archive

ui.View.present('sheet') will probably be too small in Pythonista v2

ccc

If your script does view.present('sheet') you might find that your view is too small in Pythonista v2.

One possible fix would be to size your view prior to presenting it.

view.width = view.height = min(ui.get_screen_size())
view.present('sheet')
Killwas

This happened to me when I used ui .View.present(self, sheet') in ui.View.__init__().

def __init__(self):
        # ...
        self.present('sheet')

At this time the UI elements are not initialized and the size is 100 x 100. I moved it to ui.View.did_load(self) and it worked out alright.

def did_load(self):
        # ...
        self.present('sheet')

Thanks to the wonderful debugger in pythonista 3!

jurtly

This be the answer. Thank you guys very much for questioning, and answering.