xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:divider="@drawable/opc"
android:showDividers="middle"
xmlns:android="http://schemas.android.com/apk/res/android">
<LinearLayout
android:layout_width="100dp"
android:layout_height="300dp"
android:layout_weight="2"
android:background="#ff0000"
android:layout_gravity="center"
/>
<LinearLayout
android:layout_width="100dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:background="#00ff00"
/>
<LinearLayout
android:layout_width="100dp"
android:layout_height="100dp"
android:background="#0000ff"
/>
</LinearLayout>
<!--垂直分布-->
<!-- vertical-->
<!--水平分布-->
<!-- horizontal-->
<!--设置控件的权重数值高权重高。宽高是match_parent,不建议,计算麻烦。建议设计为0dp,并且加权重-->
<!-- layout_weight-->