Orientation issues

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
John
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 30
Joined: Sun Jul 02, 2006 9:41 pm

Orientation issues

Post by John » Sun Jan 02, 2011 9:18 pm

I recently submitted an iPad app that I expect will be rejected shortly due to supported orientations. Apples guidelines indicate you should support all orientations unless you have a compelling reason not to. If that is the case they want at least two orientations. In my case that would be portrait and portrait upside down.

The problem is I cannot seem to get that working properly. Trying

local orientation1 = "portrait"
local orientation2 = "portrait upside down"
....
iphoneSetAllowedOrientations orientation1,orientation2

locks me into portrait only.

If I leave iphoneSetAllowedOrientations out then the interface auto rotates which is a problem for my layout. How should I be doing this? I am using 4.5.2 and I am testing on the device.

Thanks,
John

richardmac
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 211
Joined: Sun Oct 24, 2010 12:13 am

Re: Orientation issues

Post by richardmac » Sun Jan 02, 2011 11:13 pm

I too am interested in this. I have another orientation question but I don't want to hijack this thread so I'll start a different one.

Randy Hengst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 157
Joined: Thu Jun 29, 2006 4:16 pm

Re: Orientation issues

Post by Randy Hengst » Mon Jan 03, 2011 12:34 am

Hi John,

I had orientation problems in 4.5.2 also. Rev folks are aware of the issue and the problem seems to have been fixed in 4.5.3 (rc3).

I saw the problem when trying to limit the orientation to landscape.... In 4.5.2 you need to set the orientations in the App Settings and then include a startup handler on the stack script.... here's how I did it.

on startUp
local tMyOrientations
put "landscape left,landscape right" into tMyOrientations
iphoneSetAllowedOrientations tMyOrientations
end startUp

Now when you open the app while holding the iPad in landscape all is well.....

The catch is... if you open the app on the iPad while holding it in portrait, the app will open in landscape, but will then immediately rotate to portrait.... I then rotate the iPad to landscape and the app rotates and then locks into landscape and won't rotate to portrait again....

So, follow this pattern for your portrait and upside down orientations.... then open your app while holding the iPad in landscape and you should see the problem. But, if you then open the app while holding the iPad in portrait all will be fine.

The startup handler is not used in 4.5.3... the settings are made in the applications settings.

I have the same app made with both 4.5.2 and 4.5.3 .... things work fine with 4.5.3.

take care,
randy

John
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 30
Joined: Sun Jul 02, 2006 9:41 pm

Re: Orientation issues

Post by John » Mon Jan 03, 2011 1:09 am

Randy,

Thank you very much! It worked like a champ. I rejected original binary with the orientation problem on iTunes Connect and uploaded the new version with proper rotation. In my case, given I want to either be in portrait or portrait upside down, it all appears correctly on the device unless you start upside down (when you do it flips right way around immediately after start up). I hope this is close enough to make it past the review process. I suppose it has to be given there is no way to control this. I have several other apps up (done in Xcode and Corona) and have not had any issues yet and I didn't want to start now.

Thanks again,
John

Post Reply