Ionic View iOS App: Screen Orientation Locked?

I am using the great Ionic View app on my iPhone 5s. It seems that whatever I do, I can only preview apps in portrait mode. Do I have to declare something in order to let my app rotate freely according to orientation?

Thanks in advance for any help!

Hello. Any ideas about that? I’m interested in that too. I test my apps in “Ionic View” iOS app. There is only portrait view and no landscape view. What can i make to correct it?
And another one question. Is there any instrument in IonicFramework to work with screen orientation? Thanks
PS Editing config.xml file with <preference name="orientation" value="landscape[|default]" /> has no effect. Added plugin “org.apache.cordova.device-orientation” to project with no effect.

I have this problem too :frowning: only way I’ve gotten around it is by editing it directly in xcode, of course then whenever I do a build my changes are overwritten.

I also edit the project in Xcode, it doesn’t seem to be reset every time (not sure how and where the setting is stored though !).

Another way that I also use “just to be sure” is to add a JS event callback, as in this SO answer: http://stackoverflow.com/questions/10999435/why-doesnt-my-cordova-phonegap-ios-app-rotate-when-the-device-rotates/28203969#28203969

2 Likes

Currently, you can only do it programmatically using Cordova net.yoik.cordova.plugins.screenorientation plugin.

It uses a simple syntax:

// set to either landscape
screen.lockOrientation('landscape');

// allow user rotate
screen.unlockOrientation();

Find more about it here, including a working example you can play with: http://www.gajotres.net/changing-locking-screen-orientation-in-ionic-application/

In my simple app, this also has no effect and still permits me to rotate the orientation. Any other ideas?

This issue can be fixed without any plugin specifying orientation as ‘all’ in config.xml

<platform name="ios">
  <preference name="Orientation" value="all" />
</platform>

Reference:
https://cordova.apache.org/docs/en/5.4.0/config_ref/index.html#link-4