修改Android項(xiàng)目的AndroidManifest.xml設(shè)置:
1、控制屏幕方向(橫屏/豎屏),默認(rèn)自動(dòng)切換,修改Activity的配置:
//豎屏
android:screenOrientation="portrait"
//橫屏
android:screenOrientation="landscape"
2、不顯示窗口標(biāo)題(window title),最大化窗口,默認(rèn)顯示,修改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、不顯示狀態(tài)條(state bar),完全全屏(fullscreen),默認(rèn)顯示,修改程序:
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博客,轉(zhuǎn)載請標(biāo)明出處:http://blog.csdn.net/netpirate/archive/2009/05/26/4216306.aspx
posted on 2009-08-29 23:25
Xu Jianxiang 閱讀(2944)
評論(0) 編輯 收藏 所屬分類:
Android