Paul Oostenrijk
Paul Oostenrijk

Reputation: 659

Screen orientation ios

I am working on a application for ios with phonegap and jqm. I want to lock the screen orientation to landscape on just one page. The other pages have to be locked on portrait. I have seen a plugin that can do this but its only available for android.

My question? Is there a way to also do this on ios?

Thanks in advance!

Upvotes: 9

Views: 1277

Answers (2)

yeyene
yeyene

Reputation: 7380

Check some JQM API here...( haven't test yet )

http://api.jquerymobile.com/orientationchange/

Orientationchange Timing

The timing of the orientationchange event with relation to the change of the client height and width is different between browsers, though the current implementation will give you the correct value for event.orientation derived from window.orientation. This means that if your bindings are dependent on the height and width values you may want to disable orientationChange altogether with $.mobile.orientationChangeEnabled = false to let the fallback resize code trigger your bindings.

http://jquerymobile.com/demos/1.2.0/docs/api/globalconfig.html

You can override default settings by extending the $.mobile object using jQuery's $.extend method.

$(document).bind("mobileinit", function(){
  $.extend(  $.mobile , {
    foo: bar
  });
});

Upvotes: 1

silverchair
silverchair

Reputation: 942

Not unless you write an iOS plug-in for this functionality or find another that is for iOS. PhoneGap only offers to lock the screen orientation of the whole UIWebView, so customization for specific parts of your app is up to you/devs.

Upvotes: 0

Related Questions