zoukankan      html  css  js  c++  java
  • 安卓如何限制横屏和竖屏

    在开发android的应用中,有时候需要限制横竖屏切换。

    只需要在AndroidManifest.xml文件中加入android:screenOrientation属性限制。

    android:screenOrientation="landscape"是限制此页面横屏显示, 
    android:screenOrientation="portrait"是限制此页面数竖屏显示。 
    例如:我现在想让所有的页面不管怎么样都竖屏显示,
    则我的AndroidManifest.xml应该这样写: 


                <activity android:name=".OneDomeActivity" android:screenOrientation="portrait" android:launchMode="singleTask"/>
                <activity android:name=".TowDomeActivity" android:screenOrientation="portrait" android:launchMode="singleTask"/>
                <activity android:name=".ThreeDomeActivity" android:screenOrientation="portrait" android:launchMode="singleTask"/>
                <activity android:name=".FourDomeActivity" android:screenOrientation="portrait" android:launchMode="singleTask"/>
                <activity android:name=".FiveDomeActivity" android:screenOrientation="portrait" android:launchMode="singleTask"/>
  • 相关阅读:
    平台架构设计及市场分析
    编写jQuery插件
    分布式锁
    初探12306售票算法(一)- 理论(转)
    年后跳槽如何准备?(转)
    therefore/so/hence/then/accordingly/Thus
    ignore,neglect,omit,overlook
    OOA/OOD/OOP(转)
    SQL Server里的 ISNULL 与 NULLIF
    稀疏矩阵
  • 原文地址:https://www.cnblogs.com/netcorner/p/4644656.html
Copyright © 2011-2022 走看看