orientation control

Getting into LiveCode for iOS? Ask your questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
adventuresofgreg
Posts: 349
Joined: Tue Oct 28, 2008 1:23 am
Contact:

orientation control

Post by adventuresofgreg » Sat Apr 30, 2011 10:25 pm

Hi: I've been using the following code to control orientation specific to each card (some are landscape and some are portrait, but none are both/either)

if the environment is "mobile" then
put "portrait,portrait upside down" into theallowed
iphoneSetAllowedOrientations theallowed
end if

And it does work, but when as soon as you navigate to the page. the page stays the same orientation until the iphone is turned - then the new orientation rules become effective and it stays that way.

Is there a better way to force the orientation?

CALL-151
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 206
Joined: Wed Oct 20, 2010 11:00 am

Re: orientation control

Post by CALL-151 » Fri May 06, 2011 9:17 pm

Rather than waiting for the orientation to change, you should be able to force a specific orientation by using iphoneLockOrientation in an openCard (or a preOpenCard) handler. You should then be able to unlock to allow the orientation to change within the confines of your allowed orientations.

Post Reply