代码:
<?xml version="1.0" encoding="utf-8"?> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="ring" android:thickness="50dp" android:useLevel="false"> <gradient android:angle="0" android:centerColor="@android:color/holo_orange_dark" android:endColor="@android:color/holo_blue_dark" android:startColor="@android:color/holo_red_dark" /> </shape> </item> <item> <shape android:shape="ring" android:thickness="20dp" android:useLevel="false"> <solid android:color="@android:color/holo_red_light" /> </shape> </item> <item> <shape android:shape="ring" android:thickness="10dp" android:useLevel="false"> <solid android:color="@android:color/holo_orange_light" /> </shape> </item> <item> <shape android:shape="ring" android:thickness="2dp" android:useLevel="false"> <solid android:color="@android:color/holo_blue_light" /> </shape> </item> </layer-list>
结果:
附录:
1,《Android layer-list(1)》链接地址:http://blog.csdn.net/zhangphil/article/details/51720924
2,《Android layer-list:联合shape(2)》链接地址:http://blog.csdn.net/zhangphil/article/details/51721283
3,《Android layer-list(3)》链接地址:http://blog.csdn.net/zhangphil/article/details/51721816
4,《Android ImageView加载圆形图片且同时绘制圆形图片的外部边缘边线及边框》链接地址:http://blog.csdn.net/zhangphil/article/details/51944262
5,《Android GradientDrawable的XML实现》链接地址:http://blog.csdn.net/zhangphil/article/details/52055182
6,《Android渲染器Shader:LinearGradient(一)》链接:http://blog.csdn.net/zhangphil/article/details/52004027
7,《Android渲染器Shader:梯度渐变扫描渲染器SweepGradient(二)》链接:http://blog.csdn.net/zhangphil/article/details/52021677
8,《Android渲染器Shader:环状放射渐变渲染器RadialGradient(三)》链接:http://blog.csdn.net/zhangphil/article/details/52023723
9,《Android ShapeDrawable之OvalShape、RectShape、PaintDrawable、ArcShape》链接:http://blog.csdn.net/zhangphil/article/details/52025152
10,《Android View加载圆形图片且同时绘制圆形图片的外部边缘边线及边框:LayerDrawable实现》链接:http://blog.csdn.net/zhangphil/article/details/52035255
11,《 Android版网易云音乐唱片机唱片磁盘旋转及唱片机机械臂动画关键代码实现思路》链接:http://blog.csdn.net/zhangphil/article/details/52045404
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/3147.html