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

问题描述

我使用phonegap库(Phonegap 0.9.6)在iPhone上做了一个简单的应用程序.我喜欢使用方向功能,但是如果旋转设备,屏幕不会改变.我尝试了一些方法,但没有任何效果.我将这些行添加到了_Info.plist:

I make a simple application to iPhone with the phonegap library (Phonegap 0.9.6). I like to use the orientation function, but if I rotate the device, the screen don't change.I tried a few things, but none worked.I added these lines to _Info.plist:

   <array>
      <string>UIInterfaceOrientationPortrait</string>
      <string>UIInterfaceOrientationLandscapeLeft</string>
      <string>UIInterfaceOrientationPortraitUpsideDown</string>
      <string>UIInterfaceOrientationLandscapeRight</string>
   </array>

接下来尝试将这些相同的行添加到PhoneGap.plist.我尝试使用javascript,但无法正常工作.有人知道解决办法吗?

Next try to add these same lines to the PhoneGap.plist.I try to use javascript, but don't work. Anybody know thw solution?

推荐答案

您需要将它们添加到YOUR_APP_NAME-Info.plist中:

You need to add these to YOUR_APP_NAME-Info.plist :

对于iPad:

    <key>UISupportedInterfaceOrientations~ipad</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationPortraitUpsideDown</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>

对于iPhone:

<key>UISupportedInterfaceOrientations</key>
<array>
    <string>UIInterfaceOrientationPortrait</string>
</array>

这篇关于iPhone Phonegap方向问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 06:59