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

转载于:https://www.cnblogs.com/hehehaha/p/6147272.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值