Android 圆角实现

方法一code

Path mPath = new Path();
 mPath.reset();
 mPath.moveTo(0, mRadius);
 mPath.arcTo(new RectF(0, 0, mRadius * 2, mRadius * 2), 180, 90);
 mPath.arcTo(new RectF(w - mRadius * 2, 0, w, mRadius * 2), 270, 90);
 mPath.arcTo(new RectF(w - mRadius * 2, h - mRadius * 2, w, h), 0, 90);
 mPath.arcTo(new RectF(0, h - mRadius * 2, mRadius * 2, h), 90, 90);
 mPath.close();