首先创建一个简单的ListView,并设置对应的属性
1 <ListView
2android:id="@+id/artistsNameView"
3android:layout_width="fill_parent"
4android:layout_height="match_parent"
5android:divider="@drawable/jblineshape"
6android:dividerHeight="1sp">
7</ListView>
1 注意其中两句:对应的就是设置ListView中的Item之间的间隙线的,使用的一个XML文件:jblineshape.xml(实现的是渐变线的效果)
2
3 --->> android:divider="@drawable/jblineshape"
4 --->> android:dividerHeight="1sp"
01 配置文件:jblineshape.xml,为渐变效果的,透明->白色->透明(可根据自己需要进行设置)
02
03 <?xml version="1.0" encoding="utf-8"?>
04 <shape xmlns:android="http://schemas.android.com/apk/res/android" >
05<gradient
06android:startColor="#00000000"
07android:centerColor="#FFFFFF"
08android:endColor="#00000000"
09/>
10<corners
11android:radius="4dp"
12/>
13
14 </shape>
效果图:
作者:tombeer