Status Bar Is White When Entering Immersive Full Screen Mode
I make a simple projet about immersive full screen mode according to Using Immersive Full-Screen Mode But first of all it perfect fine when I select Make Immersive button, app is e
Solution 1:
make transparent the status bar in your theme
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:windowNoTitle">true</item>
<item name="android:windowTranslucentStatus">true</item>
<item name="android:windowTranslucentNavigation">true</item>
onCreate
Windowwindow = getWindow();
WindowManager.LayoutParams winParams = window.getAttributes();
winParams.flags &= ~WindowManager.LayoutParams.FLAG_TRANSLUCENT_STATUS;
window.setAttributes(winParams);
window.getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_LAYOUT_STABLE
|View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
Solution 2:
I solved this for temporary. Doing requestLayout
after making fullscreen mode
Here is my codes
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
findViewById(android.R.id.content).requestLayout();
View mDecorView = getWindow().getDecorView();
mDecorView.setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY);
Post a Comment for "Status Bar Is White When Entering Immersive Full Screen Mode"