答案 0 :(得分:1)
尝试以下解决方案
<LinearLayout
android:layout_width="match_parent"
android:weightSum="3"
android:orientation="vertical"
android:layout_height="match_parent">
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp"></LinearLayout>
<LinearLayout
android:orientation="horizontal"
android:id="@+id/linMiddle"
android:layout_width="match_parent"
android:layout_weight="1"
android:background="#ff0000"
android:layout_height="0dp">
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_weight="1"
android:layout_height="0dp"></LinearLayout>
</LinearLayout>
您已将runtime twice width
提供给linMiddle