android:fitsSystemWindows not working

Use CoordinatorLayout as root for your view, it worked for me.

< xmlns:android=""

My problem was most likely related to multiple/nested fitsSystemWindows attributes which does not work as I found out later. I solved my problem by applying the attribute to one view, and then copy the paddings to other views that need them via an ViewTreeObserver.OnGlobalLayoutListener. That is an ugly hack, but does its job for now.

I meet the same problem in Android 4.4

My problem is <item name="android:windowTranslucentStatus">true</item>

conflict with <item name="android:fitsSystemWindows">true</item>

My way is remove
<item name="android:windowTranslucentStatus">true</item>

Leave a Comment