android - Padding error with fitsSystemWindows on Kitkat -
i trying use kitkat's transparent navigation bars feature, , weird effect:
padding seems added bottom of view when add fitssystemwindows
attribute true
. attribute added first view doesn't align top , displayed behind status bar.
this want , expect:
but get:
i tested textview
s well, same result. can't work, guess i'm missing something.
below code:
file values-19/styles.xml
:
<style name="apptheme" parent="android:theme.holo.noactionbar.translucentdecor"> </style>
my layout file:
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#800" android:orientation="vertical" > <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#80f0" android:fitssystemwindows="true" android:src="@drawable/ic_launcher" /> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#800f" android:src="@drawable/ic_launcher" /> </linearlayout>
you should put android:fitssystemwindows
on linearlayout instead of imageview.
<linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="#800" android:orientation="vertical" android:fitssystemwindows="true" > <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#80f0" android:src="@drawable/ic_launcher" /> <imageview android:layout_width="wrap_content" android:layout_height="wrap_content" android:background="#800f" android:src="@drawable/ic_launcher" /> </linearlayout>
Comments
Post a Comment