可能重复:
Android Drawing Separator/Divider Line in Layout?如何绘制两个线性布局
在我的活动我也有重物1父LinearLayout中有重量2。现在我用两个Linearlayouts想要在两个子元素Linearlayouts之间画一条线?
可能重复:
Android Drawing Separator/Divider Line in Layout?如何绘制两个线性布局
在我的活动我也有重物1父LinearLayout中有重量2。现在我用两个Linearlayouts想要在两个子元素Linearlayouts之间画一条线?
无论重量,您可以通过使用一个视图中绘制一个水平线,例如:
<View
android:layout_width="fill_parent"
android:layout_height="1dip"
android:background="#ffffffff" />
就再拍LinearLayout中的2个布局之间 - 在这里 2儿童LinearLayouts简单的例子,每个2个textviews 。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/hello"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"/>
</LinearLayout>
<!-- In between 2 child layouts -->
<LinearLayout
android:layout_height="3dp"
android:layout_width="fill_parent"
android:background="@color/white"/>
<LinearLayout
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:orientation="vertical">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"/>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="@string/hello"/>
</LinearLayout>
</LinearLayout>