Closed shamsundhar closed 9 years ago
You can do so by overriding onDraw method in CircleImageView like the following:
private final Paint mPaint = new Paint(Paint.ANTI_ALIAS_FLAG);
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
int cx = getWidth() / 2;
int cy = getHeight() / 2;
int strokeWidth = 4;// TODO :: Load from dimensions or take density into account.
int radius = (getWidth() - strokeWidth) / 2;
mPaint.setARGB(255, 255, 0, 0);
mPaint.setStyle(Paint.Style.STROKE);
mPaint.setStrokeWidth(4);
canvas.drawCircle(cx, cy, radius, mPaint);
}
Hi Mostafa, I used your Circular ImageView, it was good. But I need to add border for that circular image view. How can I do that. Please help me in resolving this issue. Thanks in advance.