Android渐变GradientDrawable叠加组合环ring



Android渐变GradientDrawable叠加组合环ring

写一个Android环形shape之间的叠加组合形成新图像的例子。
代码:

<?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

posted on 2016-07-29 11:18  疯子123  阅读(354)  评论(0编辑  收藏  举报

导航