隨筆-1  評論-68  文章-98  trackbacks-0

          修改Android項目的AndroidManifest.xml設置:

          1、控制屏幕方向(橫屏/豎屏),默認自動切換,修改Activity的配置:

          //豎屏

          android:screenOrientation="portrait"
          //橫屏

          android:screenOrientation="landscape"

          2、不顯示窗口標題(window title),最大化窗口,默認顯示,修改Activity的配置:


          android:theme="@style/Theme"
          //res/values/styles.xml

          <style name="Theme" parent="android:Theme">
              <item name="android:windowBackground">@null</item>
              <item name="android:windowNoTitle">true</item>
          </style>

          3、不顯示狀態條(state bar),完全全屏(fullscreen),默認顯示,修改程序:

          getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
              WindowManager.LayoutParams.FLAG_FULLSCREEN);
          requestWindowFeature(Window.FEATURE_NO_TITLE);

          4、獲取屏幕的方向:橫屏/豎屏。。。


          if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE)
          {
          Log.i("info", "landscape");
          }
          else if (this.getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT)
          {
          Log.i("info", "portrait");
          }

           

          本文來自CSDN博客,轉載請標明出處:http://blog.csdn.net/netpirate/archive/2009/05/26/4216306.aspx

          posted on 2009-08-29 23:25 Xu Jianxiang 閱讀(2947) 評論(0)  編輯  收藏 所屬分類: Android
          主站蜘蛛池模板: 呈贡县| 宁陕县| 南投县| 达拉特旗| 湖州市| 尼勒克县| 金阳县| 阜宁县| 遵义县| 兴义市| 石屏县| 工布江达县| 潼南县| 微山县| 浦江县| 孙吴县| 商丘市| 沈阳市| 基隆市| 黄平县| 太仓市| 陇西县| 蒙山县| 泰和县| 铜川市| 嵊州市| 盐津县| 新河县| 青神县| 河间市| 肥西县| 舟曲县| 商都县| 广水市| 波密县| 刚察县| 宜川县| 博湖县| 沧州市| 新竹县| 措勤县|