PhoneGap: Device orientation under iOS

冷暖自知 提交于 2019-12-04 13:18:37

I just tried it and it worked fine. Be sure to set the correct options in XCode like this:

Before you do this you build a clear Project like this ->

  1. cordova create OrientationChange com.example.com OrientationChange
  2. cd OrientationChange
  3. cordova platform add ios
  4. cordova plugin add org.apache.cordova.console (you don't need this for the orientation change but it's useful for debugging).
  5. cordova build

Run the Project in XCode (6.3 is the actual version) and give it a try - it should work!

Let me know if you need further help!

As the user above stated, you can simply change it within your Xcode project. However, this seems like a bug that has yet to be fixed with Cordova, since the Orientation setting is supposed to set this per the Cordova documentation.

http://cordova.apache.org/docs/en/4.0.0/config_ref_index.md.html#The%20config.xml%20File

I've run into the problem where a published project had to be rebuilt and I forgot to modify these settings in the Xcode project itself, resulting in the published project not having rotation capabilities. Keep that in mind.

Specific to cordova :

File called appDelegate.m in ios where is orientation is set for complete ios app in code just change that orientation and that will fix the issue, tested on IOS9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!