您的位置:首页 > 移动开发 > Android开发

Android中两种设置全屏的方法

2011-10-18 18:16 423 查看
第一种方法:

在onCreate(){

.................

..................

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

// remove notification bar

this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,

WindowManager.LayoutParams.FLAG_FULLSCREEN);

setContentView(R.layout.main);

}

第二种方法:

在AndroidManifest.xml文件中添加android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

<activity android:name=".test"

android:theme="@android:style/Theme.NoTitleBar.Fullscreen"

android:label="@string/app_name">

<intent-filter>

<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />

</intent-filter>

</activity>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: