Forum Archive

Correct iPad Screen Size

DavinE

Hi guys,

I need some help for my code example....
I am using ui.get_screen_size() to get my width and height.... but when i use the iPad in split screen the width and height is not correct... in my case both 1366 (width)

Is there a way to solve this here ?

cvp

@DavinE please, try as method of an ui.View

    def get_screen_size(self):              
        app = UIApplication.sharedApplication().keyWindow() 
        for window in UIApplication.sharedApplication().windows():
            ws = window.bounds().size.width
            hs = window.bounds().size.height
            break
        return ws,hs
DavinE

@cvp said:

@DavinE please, try as method of an ui.View
def get_screen_size(self): app = UIApplication.sharedApplication().keyWindow() for window in UIApplication.sharedApplication().windows(): ws = window.bounds().size.width hs = window.bounds().size.height break return ws,hs

@cvp my friend, this works wonderfully

Thanks a lot :D