机器人:screenOrientation =" sensorPortrait"在API +17不起作用 [英] android:screenOrientation="sensorPortrait" doesn't work on API +17

查看:802
本文介绍了机器人:screenOrientation =" sensorPortrait"在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"

不过,这似乎只在工作的的Andr​​oid 4.1.2 并落后。

However, this seems to work only on Android 4.1.2 and backward.

它不上工作的的Andr​​oid 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屋!

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