Prevent rotation from portrait to landscape

Discussions about Mainlobby running on Apple mobile devices.
ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Prevent rotation from portrait to landscape

Postby ricks » Mon Sep 27, 2010 1:00 pm

I was checking iWebKit to see if I could find a setting to prevent ML from rotating away from portrait - most scenes look terrible in landscape. Anyone know what it may be?

Rick

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Prevent rotation from portrait to landscape

Postby CinemarDave » Mon Sep 27, 2010 5:43 pm

You have to implement an event handler that fires on rotation and then cancels the rotation. I couldn't get it to work in the current release. As soon as I get it working I'll include it.

bigDvette
Expert
Expert
Posts: 718
Joined: Thu Oct 12, 2006 12:19 pm
Contact:

Re: Prevent rotation from portrait to landscape

Postby bigDvette » Mon Sep 27, 2010 7:48 pm

I don't think that will work Dave but good luck. Seems only jailbroken phones can be stopped from rotating.

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Prevent rotation from portrait to landscape

Postby CinemarDave » Mon Sep 27, 2010 8:22 pm

That's probably why I couldn't get it to work #-o

User avatar
DavidL
Simply Incredible
Simply Incredible
Posts: 11071
Joined: Sat Feb 08, 2003 9:39 am
Location: Metamora, Michigan
Contact:

Re: Prevent rotation from portrait to landscape

Postby DavidL » Mon Sep 27, 2010 9:51 pm

Android can be locked in one mode or another :)
Handy.

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Prevent rotation from portrait to landscape

Postby CinemarDave » Mon Sep 27, 2010 10:21 pm

Orientation locking is available in iOS 4 devices. Only us poor folks who have first generation models are out of luck for now. Waiting patiently for the iOS 4 release for my gen 1 iPod Touch.

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Re: Prevent rotation from portrait to landscape

Postby ricks » Mon Sep 27, 2010 10:52 pm

Any pointers on how to do this for iOS4 iPhones?

User avatar
CinemarDave
Site Admin
Site Admin
Posts: 10535
Joined: Fri Feb 07, 2003 8:56 am
Location: Planet Earth
Contact:

Re: Prevent rotation from portrait to landscape

Postby CinemarDave » Mon Sep 27, 2010 10:55 pm

See this blog.

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Re: Prevent rotation from portrait to landscape

Postby ricks » Tue Sep 28, 2010 10:17 am

Thanks for the pointer. Didn't even know I could hit the home button twice. :? The good news is that it works nicely for MLiPhone. The bad news is that it is not app-specific, all rotation is disabled. I'll keep poking around the iwebkit to see if anyone comes up with a way to code it into a specific web app.

Thanks,
Rick

User avatar
jjjukebox
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1024
Joined: Sat May 22, 2004 9:54 pm
Location: Toronto
Contact:

Re: Prevent rotation from portrait to landscape

Postby jjjukebox » Tue Sep 28, 2010 2:29 pm

Not sure if this works for all devices but what I did was:

To enable landcape for pages I put this tag in each header:
<meta name = "viewport" content = "width = device-width">

To not use landcape:
<meta name = "viewport" content = "initial-scale = 2.3, user-scalable = no">

May be worth a try.
Later
J.J. Jukebox
Member

ricks
Is there life beyond Cinemar?
Is there life beyond Cinemar?
Posts: 1127
Joined: Wed Oct 27, 2004 7:01 pm
Location: Latham, Massachusetts
Contact:

Re: Prevent rotation from portrait to landscape

Postby ricks » Tue Sep 28, 2010 4:01 pm

Didn't work on my phone. Made the scene huge. I'll keep fiddling with it.

Thanks,


Return to “MainLobby on iPhone, iPod Touch”

Who is online

Users browsing this forum: No registered users and 1 guest