FrameLayout 的 layout_weight 是 0.13 但看起来比它大得多。为什么?很多推荐都是 android:layout_height="0dp",但它没有帮助。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent" android:background="@drawable/background" android:weightSum="1">
    <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp" android:background="@drawable/bar_background" android:layout_weight="0.13">
        <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:text="@string/header"
                android:id="@+id/textView" android:layout_gravity="center" android:textSize="@dimen/header_size"
                android:textColor="#ffffff" android:layout_marginTop="@dimen/header_margin_top" />
    </FrameLayout>
    <LinearLayout
            android:orientation="vertical"
            android:layout_width="match_parent"
            android:layout_height="match_parent">
        <EditText
                android:inputType="text"
                android:layout_width="match_parent"
                android:layout_height="48dp"
                android:id="@+id/textEdit"/>
        <ImageView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:id="@+id/imageView" android:layout_gravity="center" android:src="@drawable/separator"
                android:scaleType="fitXY"/>
        <ListView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:id="@+id/listView" android:layout_gravity="center" android:choiceMode="singleChoice"
                android:scrollingCache="false" android:cacheColorHint="#00000000"/>
    </LinearLayout>
</LinearLayout>