android 界面全屏

android 2.3后全屏可以:
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
.requestWindowFeature(Window.FEATURE_NO_TITLE);
但是到4.0后,下面还是存在statusbar,
解决方法:
oncreate中:

    int sdk_Version = android.os.Build.VERSION.SDK_INT;
    if (sdk_Version > 11) {
    getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
    }

    setContentView(R.layout.main_frame);

manifest里面添加:

<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Holo.NoActionBar.Fullscreen"
    >

你可能感兴趣的:(android 界面全屏)