我希望我的Android应用程序将仅在纵向模式下运行? [英] I want my android application to be only run in portrait mode?
本文介绍了我希望我的Android应用程序将仅在纵向模式下运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望我的Android应用程序将仅在纵向模式下运行? 我该怎么办呢?
I want my android application to be only run in portrait mode? How can I do that?
推荐答案
在清单中,设置此为您的所有活动:
In the manifest, set this for all your activities:
<activity android:name=".YourActivity"
android:configChanges="orientation"
android:screenOrientation="portrait"/>
让我来解释一下:
- 使用
机器人:configChanges =定向
你告诉Android的,你会负责的取向变化 -
机器人:screenOrientation =肖像
设置默认的方向模式
- With
android:configChanges="orientation"
you tell Android that you will be responsible of the changes of orientation. android:screenOrientation="portrait"
you set the default orientation mode.
这篇关于我希望我的Android应用程序将仅在纵向模式下运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文