2017-09-11 51 views
1

在这里我附上了我的问题的参考图像。 我想在两个项目之间提供完全相同的外观和感觉(它们没有给出整个宽度的线)。 如何给这样的线。如何在android中为ListView设计UI?

enter image description here

回答它

<View 
    android:layout_width="match_parent" 
    android:layout_height="1dp" 
    android:layout_marginLeft="56dp" 
    android:layout_alignParentBottom="true" 
    android:background="#BCBCBC" 
    /> 
从我身边

预期的答案 看的这张照片 enter image description here

+0

是指你标记的行 –

+0

你有什么Ë试过?添加您的XML内容 –

+0

及其与自定义项目装饰 – tyczj

回答

0

可以使用View画出简单的线条像下面的代码

<View 
    android:layout_width="match_parent" 
    android:layout_height="1dp" 
    android:background="#BCBCBC"/> 
+0

除了直接复制我的意见,是不是你如何为一个回收站查看物品装饰 – tyczj

1
<View 
    android:layout_width="match_parent" 
    android:layout_height="1dp" 
    android:layout_marginLeft="56dp" 
    android:layout_alignParentBottom="true" 
    android:background="#BCBCBC" 
    /> 

预计从我身边回答看看这个PIC

result

0

有ListView中的属性,在那里用户可以在每个项目的后面添加分隔为陈述如下: -

<ListView 
android:id="@+id/ListView01" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:divider="@color/redBackground" 
android:dividerHeight="1dip"></ListView> 

对于RecyclerView你可以查看this Stackoverflow post