PhoneGap:iOS下的设备方向 [英] PhoneGap: Device orientation under iOS

查看:90
本文介绍了PhoneGap:iOS下的设备方向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下

phonegap create hello-world com.hello.world HelloWorld

使用PhoneGap 4.2.0-0.25.0。但是,我无法在iPhone或模拟器上将视口方向更改为横向。我试图在我的config.xml下面的两个方法。

With PhoneGap 4.2.0-0.25.0. However, I am not able to change the viewport orientation to landscape on the iPhone or the simulator. I tried the following two methods within my config.xml.

< preference name =orientationvalue =default/>

< preference name =orientationvalue =landscape/>

我仍然无法在横向模式中使用应用程式。 (当然我禁用了iPhone上的任何旋转锁。)

I am still not able to use the app in landscape mode. (Of course I disabled any rotation locks on my iPhone.)

有人知道如何解决这个问题吗?

Does anybody know how to solve this?

推荐答案

我只是试过它,它工作正常。请务必在XCode中设置正确的选项,如下所示:

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 Orientation Change

  2. cd OrientationChange

  3. cordova平台添加ios

  4. cordova插件添加org.apache.cordova.console

  5. cordova build
  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

在XCode中运行项目(6.3是实际版本),然后尝试一下 -

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!

这篇关于PhoneGap:iOS下的设备方向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆