I need a stack where a card must be seen in portrait orientation and another in landscape orientation.
Is there a way to set the interface orientation of a card (iphoneOrientation prop) independently of the current device orientation (iphoneDeviceOrientation prop)?
device orientation
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
- VIP Livecode Opensource Backer
- Posts: 1236
- Joined: Sat Apr 08, 2006 1:10 pm
- Location: Zurich
- Contact:
Re: device orientation
As with SQL and XML, RunRev decided to simply port the pre-existing C functionality one-to-one into LC, producing an almost unusable mess. But you should be able to cobble something together by using these facts:
orientationChanged is sent before anything happens to the orientation
iphoneLockOrientation keeps the current orientation of the stack/card, no matter what the iphoneDeviceOrientation changes to.
iphoneLock- and iphoneUnlockOrientation work like lock screen and unlock screen.
when the autorotation actually happens, it checks the iphoneSetAllowedOrientations, which is on startup what you did set in the standalone builder.
So one way to do it would be:
orientationChanged is sent before anything happens to the orientation
iphoneLockOrientation keeps the current orientation of the stack/card, no matter what the iphoneDeviceOrientation changes to.
iphoneLock- and iphoneUnlockOrientation work like lock screen and unlock screen.
when the autorotation actually happens, it checks the iphoneSetAllowedOrientations, which is on startup what you did set in the standalone builder.
So one way to do it would be:
Code: Select all
on opencard
if the short name of this card = "mode1" then
iphoneSetAllowedOrientations "portrait,portrait upside down" --only upside
if the short name of this card = "mode2" then
iphoneSetAllowedOrientations "landscape left,landscape right" --only widescreen
end if
end opencard
Various teststacks and stuff:
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
http://bjoernke.com
Chat with other RunRev developers:
chat.freenode.net:6666 #livecode
Re: device orientation
My problem is:
- starting from a landscape oriented iPhone, with a landscape oriented card
- arriving to a landscape oriented iPhone (the device is not rotated) but with a portrait oriented card (the image is rotated)