Android 带图标的自定义半圆进度条

2020-09-04  本文已影响0人  SkyHe2022

其他不多說,首先我们来看下效果图

1、若要不同的开口大小,不同的前置色,不同的後置色,默认进度,左边图标,右边图标,是否显示左右图标等效果,只需赋予不同属性值即可

<declare-styleable name="custom">

    <attr name="angel" format="float" />

    <attr name="front_color" format="color" />

    <attr name="back_color" format="color" />

    <attr name="progress" format="float" />

    <attr name="left_icon" format="reference" />

    <attr name="right_icon" format="reference" />

    <attr name="show_right_icon" format="boolean" />

    <attr name="show_left_icon" format="boolean" />

    <attr name="show_current_point" format="boolean" />

</declare-styleable>

2,也可以使用代码手动设置前置颜色和进度等

也奉上demo的地址 :http://www.demodashi.com/demo/17457.html

上一篇 下一篇

猜你喜欢

热点阅读