如何将布局方向固定为垂直? [英] How to fix layout orientation to vertical?
本文介绍了如何将布局方向固定为垂直?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何将布局方向固定为纵向,并且不允许在运行时从纵向更改为横向?
How to fix layout orientation to portrait and do not allow changing from portrait to landscape during run time?
推荐答案
在您的 AndroidMainfest.xml
文件中,找到您希望锁定到给定轮播的活动的标签,并添加以下属性:
In your AndroidMainfest.xml
file find the tags of the activities you wish to lock to a given rotation, and add this attribute:
android:screenOrientation="portrait"
这篇关于如何将布局方向固定为垂直?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文