我想剪一个圆形区域,但不知怎的,我有一个矩形,而不是圆形。 这是我的代码:
protected boolean drawChild(Canvas canvas, View child, long drawTime) {
mRevealPath.reset();
mRevealPath.addCircle(mCenterX, mCenterY, mRevealRadius, Path.Direction.CW);
final int state = canvas.save();
canvas.clipPath(mRevealPath);
boolean isInvalidate = super.drawChild(canvas, child, drawTime);
canvas.restoreToCount(state);
return isInvalidate;
}
我在其中添加一个带有TextView的LinearLayout作为孩子进行测试。