2017-02-27 52 views
-2

我想創建如下所示的可繪製對象,以便我可以在運行時調整顏色。如何創建如下的圓形可繪製對象

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

我可以輕鬆地創建可提拉與周圍顏色的中風,但它的作用是創建圓的邊緣線,但我需要與內部的白線與外部中心顏色相同?

任何人有任何想法?

謝謝

回答

1

發現我想this是你在找什麼。

您基本上覆蓋了您的視圖的onDraw方法,並使用鏈接上的參數調用drawCircle(x, y, radius, paint)