change orientation on just one card

J. Landman Gay jacque at hyperactivesw.com
Tue Jun 11 23:12:50 EDT 2013


On 6/11/13 8:40 PM, Thomas McGrath III wrote:
> Has anyone been successful in having just one card in an app be
> restricted to just landscape. I have an app that is supported for all
> orientations but for one card I want to restrict the allowed
> orientations to just landscape.
>
> I tried this on the card I want to restrict but with no luck: on
> preopencard if the environment is "mobile" then
> mobileSetAllowedOrientations "landscape left,landscape right" end if
> end preopencard
>
> Is there a way to set the orientation when opening a card. I can't
> seem to discover any.

I haven't ever tried to do that, but reading the docs, it says that 
setting allowed orientations only takes effect the next time an 
orientation changes. If I'm reading it right, and the user is already in 
portrait mode, then the orientation restriction wouldn't happen until 
after they try to rotate the device at least once.

Maybe just structuring your resizestack handler on that card would be 
enough. Assuming you have a resizestack handler, always set up the 
layout to landscape if you're on that card.

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list