我希望我的Andr​​oid应用程序将仅在纵向模式下运行? [英] I want my android application to be only run in portrait mode?

查看:120
本文介绍了我希望我的Andr​​oid应用程序将仅在纵向模式下运行?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望我的Andr​​oid应用程序将仅在纵向模式下运行? 我该怎么办呢?

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.

这篇关于我希望我的Andr​​oid应用程序将仅在纵向模式下运行?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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