I want to make a completely transparent status bar and content behind it.
My device runs with 24 API.
I use this code (in my AppCompatActivity):
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
getWindow().getDecorView().setSystemUiVisibility(
View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN);
setContentView(R.layout.activity_main);
}
but it doesn't make any effect, my content is still UNDER the status bar;
I also tried to put android:fitsSystemWindows="true"
in my root view, but it didn't help either.
I also tried to put the code after setContentView, still no effect.
What am I doing wrong?
replace this with your code :