문제

I found this function. How can I now add a Stroke to my Drawable?
There is nothing like setStroke(...)

도움이 되었습니까?

해결책

Try creating a paint variable with the your intended color/stroke width/ (also set style=stroke) and then use it in the onDraw method:

onDraw(Shape shape, Canvas canvas, Paint paint)

In this way, the stroke will be added when you draw. It will not be attached to your Drawable.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top