1:纵向平分:使用button演示
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="2500dp"
android:layout_weight="3">
<Button
android:id="@+id/buttonImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="选图" />
<Button
android:id="@+id/buttonDetect"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="识别-cpu" />
<Button
android:id="@+id/buttonDetectGPU"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="识别-gpu" />
</LinearLayout>
效果:
2:横向平分:使用button演示
<LinearLayout
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="200dp"
android:layout_weight="3">
<Button
android:id="@+id/buttonImage"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="选图" />
<Button
android:id="@+id/buttonDetect"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="识别-cpu" />
<Button
android:id="@+id/buttonDetectGPU"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="识别-gpu" />
</LinearLayout>
效果: