android:windowTranslucentStatus=true,android:fitsystemwindows=true,在列表视图上方的间隙
我需要半透明的状态栏。所以我在styles.xml中使用了flagandroid:windowTranslucentStatus=true,android:fitsystemwindows=true,在列表视图上方的间隙,android,android-layout,Android,Android Layout,我需要半透明的状态栏。所以我在styles.xml中使用了flag <item name="android:windowTranslucentStatus">true</item> true my_layout.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" a
<item name="android:windowTranslucentStatus">true</item>
true
my_layout.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<include layout="@layout/tool_bar" />
<LinearLayout
android:id="@+id/containerCenter"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<ListView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:animateLayoutChanges="true"
android:background="#ffffff"
android:scrollbarStyle="outsideOverlay" />
<TextView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:gravity="center"
android:text="Test"/>
<EditText
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</LinearLayout>
单击EditText时,软键盘与EditText重叠。所以我使用标志“android:fitsystemwindows=true”来解决这个问题。好啊
但如上所述,listView上(在“工具条”和“容器中心”之间)存在高度等于状态栏高度的间隙。
我怎样才能消除这个差距
兹附上:
如果我将android:fitsystemwindows=“true”移动到最上面的线性布局
间隙消失,但状态栏不再半透明。请参见附件2