zl程序教程

您现在的位置是:首页 >  移动开发

当前栏目

android横竖屏限制的配置方法

Android配置方法 限制 横竖
2023-06-13 09:15:00 时间
在开发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">