简体   繁体   English

应用程序屏幕不会在横向模式下旋转两侧

[英]App screen won't rotate both sides on landscape mode

I'm writing an application for android that runs on landscape mode. 我正在编写一个在横向模式下运行的android应用程序。 When i'm rotating my device on 180 degrees it stays the way it is. 当我将设备旋转180度时,它保持原样。 What can i do\\change and where so it can run on both horizontal directions? 我能做什么?改变以及它可以在两个水平方向上运行的位置?

在Manifest中,在您想要拥有双方的活动中添加以下代码。

 android:screenOrientation="sensorLandscape"

Some devices just don't do the "upside down" mode. 有些设备不执行“颠倒”模式。 My Galaxy Nexus rotates only to three orientations. 我的Galaxy Nexus只旋转到三个方向。

Make sure your device is auto rotation is ON or working fine than 确保您的设备自动旋转打开或工作正常

use this code in your manifest.xml in your activity in which you waana rotate d screen. 在您使用waana旋转屏幕的活动中的manifest.xml中使用此代码。

android:screenOrientation="sensorLandscape" 机器人:screenOrientation = “sensorLandscape”

it works fine for me :) 这对我来说可以 :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM