如何创建像下面这样的圆形绘图

时间:2017-02-27 11:44:48

标签: android android-drawable

我想创建如下的drawable,以便我可以在运行时调整颜色。

Drawable when the colour is selected Drawable when the colour is not selected

我可以通过围绕颜色的笔划轻松创建可绘制的但是它所做的就是在圆的边缘创建线条,但我需要在内部使用与中心相同颜色的白线。外部

有人有什么想法吗?

由于

2 个答案:

答案 0 :(得分:1)

我认为this正是您所寻找的。

您基本上覆盖视图的onDraw方法,并使用链接上的参数调用drawCircle(x, y, radius, paint)

答案 1 :(得分:-1)

经过多次搜索后,我可能找到了解决方案。在这里找到了

How to create ring shape drawable in android?