screenrect problem...

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

screenrect problem...

Post by Dixie » Sat Nov 08, 2014 10:29 am

If I make a stack at 320 x 480 then choose 'Device > iPhone 4s' from the 'Hardware' menu then :-

Code: Select all

 put the effective working screenRect into fld 1
returns 0,0,320,480... this is expected. I change the Device to 'iPhone 5s' from the 'Hardware' menu and 0,0,320,568 is returned... this too is expected... However the same 0,0,320,568 is returned if I choose iPhone 6 or iPhone 6 plus from the 'Hardware' menu...

This is a show stopper for developing an iPhone app that you would like to run on all the iPhones from the 4s through to the 6 plus... unless of course, pockets are deep enough to have all four of the current iPhones sitting next to your Mac...:-(

Anyone else seeing this ?... Anyone got a fix so I could know which iPhone the stack is running on ?

thanks

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: screenrect problem...

Post by Dixie » Mon Nov 10, 2014 10:56 am

Mmm... No replies..:-( In the case of testing in the 'iPhone Simulator' ... How do you determine which iPhone the stack is supposed to be running on ? Up until now I have used something like this, which has worked a treat for determining a iPhone 4 or 5 :-

Code: Select all

on openStack
   if environment() = "mobile" then
      whichiPhone
end openStack
 
command whichiPhone
   if item 4 of the working screenrect = 568 then
      — do stuff here for a iPhone 5
   end if
 
   if item 4 of the working screenrect = 480 then
      — do stuff here for an iPhone 4
   end if    
end whichiPhone

but the 'screenrect' function does not return the correct response for the iPhone 6 or the iPhone 6 Plus as the function just treats it as if it were an iPhone 5 returning 0,0,320,568... so until this might get 'fixed' is there another way to get the correct dimensions returned for the iPhone 6 ?

thanks...

paulsr
Posts: 222
Joined: Thu Jul 19, 2012 9:47 am
Contact:

Re: screenrect problem...

Post by paulsr » Tue Nov 11, 2014 10:08 am

I was just about to post a similar message...

Working with the iPhone 6 Plus simulator iphoneDeviceResolution() returns 640,1136

Surely that is wrong???

--paul

Dixie
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1336
Joined: Sun Jul 12, 2009 10:53 am

Re: screenrect problem...

Post by Dixie » Tue Nov 11, 2014 10:20 am

Hi Pauler...

I posted the following on the use-list last night... I am using xCode 6.0, OSX 10.9.5, LC 7.0, iOS 8 simulator... Let me be a little pedantic here in my explanation. I have prepared a stack at a size of 320 x 480... It has one button with the following script...

Code: Select all

on mouseUp
   answer the screenRect of this stack
end mouseUp
If I choose Hardware > Devices > iPhone 4s running in the simulator returns 0,0,320,480
If I choose Hardware > Devices > iPhone 5s running in the simulator returns 0,0,320,568
but...
If I choose Hardware > Devices > iPhone 6 running in the simulator returns 0,0,320,568... It is at this point that I expected to see 0,0,375,667...

I have had a reply on the 'use-list' from Mark Wilcox who wrote... 'If you don't have the appropriate launch screen / launch images for the iPhone 6/6+ then your app gets run at iPhone 5 size and scaled up.'... So, I am just about to add splash screens to see if this will make a difference...

Dixie

Post Reply