0
votes

Im with a problem on Android. Everything is drawing below status bar and status bar is white and not the "primaryDarkColor".

I search a lot, tried a lot of solutions, but without success. I tried something like:

  1. Paint entire window but have other bad effects on other screens that dont have toolbar and only a background image (android:windowBackground).
  2. Paint statusbar with v21 style (android:statusBarColor) (but my app run on api-16)
  3. I tried "android:fitsSystemWindows" but dont work.
  4. I tried tags "windowActionBar=false" and "windowNoTitle=true".
  5. I tried "android:windowDrawsSystemBarBackgrounds=true/false", but the only effect is statusbar always black.
  6. I have create a new project to compare, and o didn't see any difference.

My project theme is simples:

<style name="AppTheme.NoActionBar" parent="Theme.AppCompat.Light.NoActionBar">
    <item name="windowActionBar">false</item>
    <item name="colorPrimary">@color/colorPrimary</item>
    <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
    <item name="colorAccent">@color/colorAccent</item>
</style>

A screenshot:

ss1

1

1 Answers

0
votes

I solve my own problem.

The problem is not related by styles, but with one fragment inside the view pager.

Activity -> View Pager -> Fragment -> Set status bar transparent.

If one of fragment is setting the statusbar as transparent, the effect will reach all fragments, since the activity is the same to all.

Thanks.