zoukankan      html  css  js  c++  java
  • setRequestedOrientation设置屏幕方向

    void android.app.Activity.setRequestedOrientation(int requestedOrientation)
     
    官方API解释:
        Change the desired orientation of this activity. If the activity is currently in the foreground or otherwise impacting the screen orientation, the screen will immediately be changed (possibly causing the activity to be restarted). Otherwise, this will be used the next time the activity is visible.
     
    中文大意:
        改变activity的期望的方向。如果activity 目前在前台或以其他方式影响屏幕的方向,屏幕将立即被改变(可能导致活动重新启动)。否则,这将在activity 下一次可见时使用。
     

    //设横屏
    setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);

  • 相关阅读:
    7月27日
    7月26日
    7月25日
    7月24日
    UI基础 选项卡
    UI基础 手势
    UI基础 小球拖拽
    UI基础 事件
    UI基础 自定义视图
    UI基础 视图控制器
  • 原文地址:https://www.cnblogs.com/shenchanghui/p/4835165.html
Copyright © 2011-2022 走看看