Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我找到了这个功能。我现在如何向我的 Drawable 添加 Stroke? 没有什么像 setStroke(...)
尝试使用您想要的颜色/笔画宽度/(也设置样式=笔画)创建一个绘制变量,然后在 onDraw 方法中使用它:
onDraw(Shape shape, Canvas canvas, Paint paint)
这样,在你画画的时候就会加上笔画。它不会附加到您的 Drawable 上。