Android ListView元素间隙线自定义渐变效果
16lz
2021-01-23
首先创建一个简单的ListView,并设置对应的属性
<ListView android:id="@+id/artistsNameView" android:layout_width="fill_parent" android:layout_height="match_parent" android:divider="@drawable/jblineshape" android:dividerHeight="1sp"> </ListView>
注意其中两句:对应的就是设置ListView中的Item之间的间隙线的,使用的一个XML文件:jblineshape.xml(实现的是渐变线的效果)--->> android:divider="@drawable/jblineshape"--->> android:dividerHeight="1sp"
配置文件:jblineshape.xml,为渐变效果的,透明->白色->透明(可根据自己需要进行设置)<?xml version="1.0" encoding="utf-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" > <gradient android:startColor="#00000000" android:centerColor="#FFFFFF" android:endColor="#00000000" /> <corners android:radius="4dp" /></shape>
效果图:
更多相关文章
- adb install将app安装到eclipse Android sdk 模拟器上看效果
- 【Android 界面效果19】Android中shape的使用
- android手指缩放效果
- Android中Market的Loading效果实现方法
- Android 自定义控件实现刮刮卡效果 真的就只是刮刮卡么
- 自定义控件及效果
- Android UI开发第十二篇――动画效果Animation(一)
- Android开发中阴影效果的实现
- Android UI开发第十二篇——动画效果Animation(一)