源码网商城,靠谱的源码在线交易网站 我的订单 购物车 帮助

源码网商城

Android 屏幕实现上下翻转

  • 时间:2021-07-26 02:44 编辑: 来源: 阅读:
  • 扫一扫,手机访问
摘要:Android 屏幕实现上下翻转
[b]Android 屏幕实现上下翻转[/b] 通常我们的应用只会设计成横屏或者竖屏,锁定横屏或竖屏的方法是在manifest.xml文件中设定属性android:screenOrientation为"landscape"或"portrait":
 <activity
      android:name="com.example.kata1.MainActivity"
      android:label="@string/app_name" 
      android:screenOrientation="landscape">
      <intent-filter>
        <action android:name="android.intent.action.MAIN" />
        <category android:name="android.intent.category.LAUNCHER" />
      </intent-filter>
    </activity>
其实screenOrientation还可以设置成很多值:
android:screenOrientation    =     ["unspecified" | "behind" |
                   "landscape" | "portrait" |
                   "reverseLandscape" | "reversePortrait" |
                   "sensorLandscape" | "sensorPortrait" |
                   "userLandscape" | "userPortrait" |
                   "sensor" | "fullSensor" | "nosensor" |
                   "user" | "fullUser" | "locked"]
其中sensorLandscape就是横屏根据重力上下翻转,sensorPortrait竖屏根据重力上下翻转。 如果有兴趣,你也可以试试其他的值哦... 感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
  • 全部评论(0)
联系客服
客服电话:
400-000-3129
微信版

扫一扫进微信版
返回顶部