I have a ShapeDrawable
:
final ShapeDrawable drawable = new ShapeDrawable(shape);
drawable.getPaint().setStyle(Paint.Style.FILL);
drawable.getPaint().setColor(0xFFffffff);
I want to set border(stroke) color and width for this drawable.
I try setStyle(Paint.Style.FILL_AND_STROKE)
but it set background and border with same color
Use
drawable.getPaint().setStyle(Paint.Style.STROKE);
drawable.getPaint().setStrokeWidth(2); // in pixel
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With