PhoneGap 3.0.0锁定方向 [英] PhoneGap 3.0.0 Locking orientation

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

问题描述

我正在使用PhoneGap上的游戏。我的游戏需要屏幕被锁定为横向模式。我需要它被锁定,所以你不能将设备转到另一个横向模式,旋转屏幕(所以,无论设备是以什么方式旋转,屏幕将不会改变方向,它将保持相同的方式,它是之前)。我试过查看这个问题,但它对我没有工作。我需要一个我可以轻松使用的解决方案,最好是Android和iOS。我使用的工具为PhoneGap,所以在终端,我运行:

  phonegap运行android 
解决方案。c $ c>



在iOS中锁定方向:只需在Xcode中打开项目,然后单击项目和内部摘要,您可以选择方向



FOr Android
add android:screenOrientation = 到每个活动例如:

 < activity android:name =。SomeActivity
android:label =@ string / app_name
android:screenOrientation =landscape>


I am working on a game in PhoneGap. My game needs the screen to be "locked" into landscape mode. I need it to be locked so that you can't turn the device into the other landscape mode, rotating the screen (so, no matter which way the device is rotated, the screen will not change orientations. It will stay the same way as it was before). I have tried looking at this question, but it didn't work for me. I need a solution that I can use easily, and preferably with Android and iOS. I am using the tools for PhoneGap, so in the terminal, I run:

phonegap run android

to build and install my app onto my tablet.

解决方案

For locking orientation in IOS : just open the project in Xcode and click on project and inside summary you can select the orientations

FOr Android add android:screenOrientation="landscape" to each activity eg:

<activity android:name=".SomeActivity"
          android:label="@string/app_name"
          android:screenOrientation="landscape">

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

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