欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

android 横竖屏限制的配置方法

程序员文章站 2023-12-06 10:21:34
在开发android的应用中,有时候需要限制横竖屏切换。只需要在androidmanifest.xml文件中加入android:screenorientation属性限制。...
在开发android的应用中,有时候需要限制横竖屏切换。只需要在androidmanifest.xml文件中加入android:screenorientation属性限制。
ndroid:screenorientation="landscape"是限制此页面横屏显示,
ndroid:screenorientation="portrait"是限制此页面数竖屏显示。
例如:我现在想让所有的页面不管怎么样都竖屏显示,则我的androidmanifest.xml应该这样写:
复制代码 代码如下:

http://schemas.android.com/apk/res/android"
     < package="com.oa"
      android:versioncode="1"
      android:versionname="1.0">

                          <android:label="@string/app_name"
                  android:screenorientation="portrait">