omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Correct iPad Screen Size

    Pythonista
    2
    3
    711
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • DavinE
      DavinE last edited by

      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 1 Reply Last reply Reply Quote 0
      • cvp
        cvp @DavinE last edited by 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 1 Reply Last reply Reply Quote 1
        • DavinE
          DavinE @cvp last edited by

          @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

          1 Reply Last reply Reply Quote 0
          • First post
            Last post
          Powered by NodeBB Forums | Contributors