`

分割线样式

阅读更多

 

android给listview设置分割线Divider样式

设置分割线的例子如下:
<ListView android:id="@+id/HomeListView" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:divider="#123"
        android:layout_margin="10dip"></ListView>

但运行后,发现样式没起作用。

解决办法:
给listview设置android:dividerHeight为非0即可。

如:
<ListView android:id="@+id/HomeListView" android:layout_width="fill_parent"
        android:layout_height="fill_parent" android:divider="#000"
        android:dividerHeight="1px"
        android:layout_margin="10dip"></ListView>
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics