【发布时间】:2015-06-08 11:42:48
【问题描述】:
在这里,我正在创建一个由多列列表视图组成的 android 应用程序。通过这个多列列表视图,我想通过在它们之间绘制一条垂直线来分隔每列的数据。谁能告诉我如何在列表视图列之间绘制垂直线。提前谢谢
这是我的列表视图布局
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context="com.developer.milanandroid.AC_fuse_ckt" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="35dp"
android:layout_below="@+id/pager_sliding_tab_strip"
android:weightSum="4" >
<TextView
android:id="@+id/txt_s.no"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="30dp"
android:text="sno"
android:textSize="20dp" />
<TextView
android:id="@+id/txt_test_point_name"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="100dp"
android:text="Pointname"
android:textSize="20dp" />
<TextView
android:id="@+id/txt_Description"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="120dp"
android:text="Description"
android:textSize="20dp" />
<TextView
android:id="@+id/txt_Range"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="110dp"
android:text="Range"
android:textSize="20dp" />
<TextView
android:id="@+id/txt_Measurement"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:layout_marginLeft="80dp"
android:text="Result"
android:textSize="20dp" />
</LinearLayout>
<View android:id="@+id/view_1"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="#BDBDBD"
android:layout_below="@+id/linearLayout1"/>
<ListView
android:id="@+id/listView_bc_fuse_ckt_tests"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:padding="20dp"
android:layout_below="@+id/linearLayout1" >
</ListView>
</RelativeLayout>
【问题讨论】:
-
您可以使用
GridView代替ListView -
能否提供包含
ListViews 的布局文件?您是使用多个ListViews 还是将每个ListItem中的列分开? -
感谢您的回复,伙计。但是,我想在这里使用列表视图是否可以使用列表视图@SandeepSingh
-
@dEePU 是的,但是你能发布你的布局
-
我发布了我的布局,请检查一下伙计@SandeepSingh
标签: android android-listview divider multiple-columns