iPhone 4 app in IPhone 5 simulator

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

iPhone 4 app in IPhone 5 simulator

Post by Jellicle » Thu Nov 22, 2012 8:02 pm

Hi all

I've been updating an iOS app already on the app store so it'll run in iOS 6.

When I run the app in the iPhone 5 simulator the stack seems to resize to fill the new screen height instead of being centred at iPhone 4 size, which I understood is the intended behaviour with retina apps that have not been re-written to fill the height of the new screen size.

Why is that happening? What am I missing?

Gerry
14" MacBook Pro
Former LiveCode developer.
Now recovering.

FireWorx
Posts: 362
Joined: Wed Sep 07, 2011 9:39 pm

Re: iPhone 4 app in IPhone 5 simulator

Post by FireWorx » Fri Nov 23, 2012 8:09 am

When I ran my iPhone4 app in the iPhone5 Sim it left a 1/2 inch gap at the bottom. I had a couple html screens that I had programed to fill the screen - 80 pixels (to expose the bottom 80 pixel high button bar) . Since the screen height was longer on the iPhone5 the button bar was actually being covered by the html window. I re-programmed the stack to check if the devise was an iPhone 4 or 5 and if it was an iPhone 5 increase the height of the stack and relocate the bottom button bar on each of the 4 cards. This script worked.

if the environment is "mobile" then
put iphoneDeviceResolution() into tScreenResolution
if tScreenResolution is "640,1136" then
## its an iPhone5 so resize the stack and move the buton bar to the bottom of the screen
lock screen
set the height of this stack to 568
set the width of this stack to 320
repeat with x = 1 to the number of cards of this stack
put "IconBar" && x into groupToLocate
put "Panel" && x into PanelToLocate
##go to card x
set the bottomleft of group groupToLocate of card x to "0,568"
set the bottomleft of group PanelToLocate of card x to "0,568"
end repeat
unlock screen
go to card 1
end if
end if

Hope this helps. I just needed to whip up a quick fix to deal with the issue at hand.
Dave

Jellicle
Posts: 453
Joined: Thu Feb 24, 2011 11:07 am

Re: iPhone 4 app in IPhone 5 simulator

Post by Jellicle » Fri Nov 23, 2012 8:41 am

Dave, thanks. Before I do the work to move stuff around (it would be a whole bunch of stuff I'd have to change, not just the button bar) I'd like to find out what should be happening - iPhone 4 apps written in Objective C seem to just run in the centre of the iPhone 5 screen without anything needing to be done..

All that said my app uses MobGUI. As that appears to be abandonware I have to consider whether a bigger rebuild is in order...

Gerry,
14" MacBook Pro
Former LiveCode developer.
Now recovering.

gpb01
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 281
Joined: Sat Jun 04, 2011 5:41 pm

Re: iPhone 4 app in IPhone 5 simulator

Post by gpb01 » Fri Nov 23, 2012 11:27 am

Jellicle wrote:Dave, thanks. Before I do the work to move stuff around (it would be a whole bunch of stuff I'd have to change, not just the button bar) I'd like to find out what should be happening - iPhone 4 apps written in Objective C seem to just run in the centre of the iPhone 5 screen without anything needing to be done..
... also my Apps written il LiveCode, if I do nothing for iPhone5, run in center of the iPhone5 screen so ... it's something you have in your configuration (stacks, scripts, standalone App settings, ...) :)
Jellicle wrote: All that said my app uses MobGUI. As that appears to be abandonware I have to consider whether a bigger rebuild is in order...
Gerry,
There are new projects at RunRev, so ... stay tuned on future releases ... ;)

Guglielmo

Post Reply