Mobile Orientation

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, kevinmiller

Post Reply
Jamie37
Posts: 53
Joined: Sat Dec 19, 2015 1:45 pm

Mobile Orientation

Post by Jamie37 » Wed Mar 30, 2016 8:43 pm

Hello,

I have used this code from this website: http://runrev.screenstepslive.com/s/352 ... ientations

Basically the problem I am having is I want the orientation to change to 'Landscrape Left' automatically when I enter one substack which is does fine. The problem is that it does not return to portrait on the other stacks. I have the code set on portrait but it does not seem to be doing anything. Can anyone help me please?

Thanks
Jamie

newtronsols
Posts: 192
Joined: Tue Mar 11, 2014 12:57 pm

Re: Mobile Orientation

Post by newtronsols » Mon Apr 04, 2016 4:01 pm

why not just allow the user to choose:

if the environment is "mobile" then

--Portrait , Portrait Upside Down , Landscape Left, Landscape Right are the 4 Parameters to be passed in the function iphoneSetAllowedOrientations

put "portrait,portrait upside down,landscape left,landscape right" into theallowed

-- Function Call

mobileSetAllowedOrientations theallowed

end if

Jamie37
Posts: 53
Joined: Sat Dec 19, 2015 1:45 pm

Re: Mobile Orientation

Post by Jamie37 » Mon Apr 04, 2016 5:01 pm

Hi newtronsois,

I need the orientation to be forced to landscape for only one substack but the rest of the app needs to be natively in portrait. Is this possible?

Jamie

MaxV
Posts: 1574
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: Mobile Orientation

Post by MaxV » Wed Apr 13, 2016 11:18 am

With mobileSetAllowedOrientations the setting take affect the next time an orientation change is applied. The interface orientation only changes if the new orientation is among the configured list.
I sugget you to use the mobileLockOrientation command to temporarily prevent orientation changes.
Livecode Wiki: http://livecode.wikia.com
My blog: https://livecode-blogger.blogspot.com
To post code use this: http://tinyurl.com/ogp6d5w

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”