Page 1 of 1

Orientations

Posted: Wed Jul 02, 2014 2:06 pm
by kararak95
Hello. the main stack of my app is portrait. and i have one substack and i want it to be landscape when opening a substack from app. can someone tell me how to do this?

Re: Orientations

Posted: Thu Jul 03, 2014 3:29 am
by Simon
Hi kararak95,
I've been trying but it hasn't been reliable.
look-up mobileSetAllowedOrientations and orientationChanged. Using those two I could get it to sort of work but doubt you'd want to make a product with it.

Simon

Re: Orientations

Posted: Mon Jul 07, 2014 5:56 pm
by newtronsols
If you create a button 'test' , then stack script

on preOpenStack
mobileSetAllowedOrientations "landscape left,portrait,landscape right,portrait upside down"
end preOpenStack

and for the card script:

on orientationChanged
local theOrientation
put mobileDeviceOrientation() into theOrientation
set the label of button "test" to theOrientation
end orientationChanged

You should see the label of a button 'test' change to the orientation selected as you move your phone through 90 degrees.

You can also force the initial orientation in the standalone settings to landscape. So you start landscape.