zoukankan      html  css  js  c++  java
  • android:screenOrientation属性

    这个android:screenOrientation我很少用到. 模模糊糊又没啥概念,今天看了一个项目用到了. 百度下记录下吧 .

    在配置文件中的使用方法如下:

    <activity
                android:name=".AppStart"
                android:label="@string/app_name"
                android:screenOrientation="portrait"//设置 该页面 只能 竖直屏幕方向显示 
                android:theme="@style/Theme.AppStartLoad">
                <intent-filter>
                    <action android:name="android.intent.action.MAIN" />
    
                    <category android:name="android.intent.category.LAUNCHER" />
                </intent-filter>
    </activity>

    还有其他几个值,但是如果用翻译软件去翻译的话.绝对把你搞蒙了.

    android:screenOrientation="" 这句话默认不写的话,其实就是android:screenOrientation="unspecified"
    这是一个默认值,有系统选择显示方向,在不同的设备上可能结果不太一样.
    android:screenOrientation="landscape"  横向屏幕
    android:screenOrientation="portrait"   竖向屏幕
    android:screenOrientation="user"       用户当前首选方向
    android:screenOrientation="behind"     与在活动/Activity堆栈下的Activity方向相同
    android:screenOrientation="sensor"     根据物理方向传感器 来确定方向,比如有的游戏既支持竖屏也支持横屏,取决于用户手持方向.
    android:screenOrientation="nosensor"   不随 物理方向传感器确定方向,该传感器呗忽略,所以当用户转动设备,显示不会跟随改变,除了这个区别. 这个怎么理解呢? 其实可以理解成系统关闭重力感应.


  • 相关阅读:
    用Python获取Linux资源信息的三种方法
    对python中元类的理解
    一道有趣的和编程无关的编程题思考
    Python编程进阶
    函数计算的 Python手册小问题
    Linux 命令
    pyechart
    KV数据库Redis
    微博API 学习记录
    非阻塞式的 requests.post 学习
  • 原文地址:https://www.cnblogs.com/android-zcq/p/5881664.html
Copyright © 2011-2022 走看看