[英]Android add Stroke to Drawable on Runtime
Try creating a paint variable with the your intended color/stroke width/ (also set style=stroke) and then use it in the onDraw method: 尝试使用所需的颜色/笔划宽度/(还设置style = stroke)创建一个绘画变量,然后在onDraw方法中使用它:
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.
它不会附加到您的Drawable。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.