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: Gajotres - Best Technology Product Reviews, News, Tips, and Comparison

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