机器人:screenOrientation =" sensorPortrait"在API +17不起作用 [英] android:screenOrientation="sensorPortrait" doesn't work on API +17
问题描述
我想我的应用程序,在纵向和放大器工作; reversePortrait模式..换句话说,我希望它在纵向的工作,并使其可旋转180度!
I want my application to work in Portrait & reversePortrait mode .. In other words, I want it to work in portrait and make it rotatable 180 degrees!
我使用中的以下code <活动方式>
在清单中的 MainActivity 的标签
I'm using the following code within <activity>
tag of the MainActivity in the Manifest.
android:screenOrientation="sensorPortrait"
不过,这似乎只在工作的的的Android 4.1.2 的并落后。
However, this seems to work only on Android 4.1.2 and backward.
它不上工作的的的Android 4.2.2 的以上!
It doesn't work on Android 4.2.2 and above!
我尝试了不同的手机,同样的结果!如何解决呢?
I tried on different phones, the same result! How to solve it?
推荐答案
我知道由谷歌一个错字错误取代 sensorPortrait
按 sensorPortait
在一些点。
I'm aware of a typo error by Google that replaced sensorPortrait
by sensorPortait
at some point.
不知道这是你的情况,但根据你的 targetApi
,它可能。
Not sure if that is your case, but depending on your targetApi
, it might.
使用 sensorPortait 并见编译会发生什么。
Use sensorPortait and see what happens at compilation.
的这已被固定在API 16。的
这篇关于机器人:screenOrientation =&QUOT; sensorPortrait&QUOT;在API +17不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!