2011-08-03 100 views
3

可能重复:
Android Drawing Separator/Divider Line in Layout?Android的 - 在垂直布局项目之间的分隔

我提出类似的列表视图的东西,实际上并没有做一个列表视图...

我在垂直布局中有一堆文本视图,我想知道是否有可能在它们之间得到某种分隔线。线条分隔线就像他们在列表视图..

任何帮助吗?

+0

您可以使用此: <查看 的android:layout_width = “match_parent” 机器人:layout_height = “1dp” android:background =“#000000”/> – elfekz

回答

20

您可以使用一个TextView创建分隔线

例子:

<TextView   
     android:layout_width="fill_parent" 
     android:layout_height="1px" 
     android:background="#DADADA" /> 
+11

不需要是TextView,常规视图将会很好,渲染速度也会更快。 – Josh

+0

是的,我只是想举个例子。 – Sam

+5

你应该使用'dp'而不是'px' – rndstr

4

你可以用任何你想要的颜色和

layout_height = "1dp"(或更多,如果necesary)和

layout_width="fill_parent"的背景插入View

相关问题