如何使应用程序仅在纵向模式下运行 [英] How to make an application to run in portrait mode only

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

问题描述

在我的应用程序,如果我要限制活动在纵向模式下工作才把我有写安卓screenOrientation =画像在打击活动清单文件标签。如果我要强制所有活动在纵向模式下工作,那么我必须写在所有的活动一样。是否有任何应用程序明智的设置,这样我不必在所有活动中这样写。如何使应用程序能够在纵向模式下只运行

我用下面的现在

 <活动
        机器人:screenOrientation =画像
        机器人:configChanges =keyboardHidden |定位
        机器人:名称=。MyActivity>< /活性GT;
 

解决方案

唯一的办法就是增加机器人:screenOrientation =肖像每个活动

In my application If i want to restrict an activity to work in portrait mode only then i have to write android:screenOrientation="portrait" in the manifest file against activity tag. If I want to force all activity to work in portrait mode then I have to write the same in all activity. Is there any application-wise setting so that I need not have to write this in all activities. How to make an application to run in portrait mode only

I am using the following now

        <activity
        android:screenOrientation="portrait"
        android:configChanges="keyboardHidden|orientation"
        android:name=".MyActivity"></activity>

解决方案

Only way is to add android:screenOrientation="portrait" for each activity.

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

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