1. 程式人生 > >android 設定全屏的三種方式

android 設定全屏的三種方式

一:動態編碼的方式:
// 去掉視窗標題
requestWindowFeature(Window.FEATURE_NO_TITLE);
// 隱藏頂部的狀態列
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView();
二:
android:theme="@android:style/Theme.Black.NoTitleBar"
android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen"三:
<style name="AppTheme" parent="AppBaseTheme">
<item name="android:windowNoTitle">true</item><!-- 沒有標題 -->
</style>