问题描述
我希望我的活动,只在纵向模式下可用 - 纵向和reversePortrait。我怎样才能做到这一点?当我设置安卓screenOrientation =画像
这将迫使活动只有在正常的肖像 - 反之亦然reversePortrait。
请不要告诉我,这是一个不错的办法,迫使/锁方向。我知道这件事情,但还是客户端请求的。感谢您的理解和任何想法。
更新: API级别11和更高
如果您在API层面9+,使用安卓screenOrientation =sensorPortrait
。 P>
Documentation
I want my activity to be available only in both portrait modes - portrait and reversePortrait. How can I achieve this? When I set android:screenOrientation="portrait"
it will force activity to be only in normal portrait - vice versa with reversePortrait.
Please, don't tell me it's a bad approach to force/lock orientation. I know about it, but still client is requesting it. Thanks for understanding and for any ideas.
UPDATE: API Level 11 and higher
If you are on API level 9+, use android:screenOrientation="sensorPortrait"
.
这篇关于在纵向或纵向反转活动只的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!