我正在尝试实现可以改变绘制路径不透明度的橡皮擦。我尝试更改Alpha,但仍然无法正常工作。
这是代码:
var mPaint = Paint()
mPaint!!.isAntiAlias = true
mPaint!!.isDither = true
mPaint!!.xfermode = PorterDuffXfermode(PorterDuff.Mode.CLEAR)
mPaint!!.style = Paint.Style.STROKE
mPaint!!.strokeJoin = Paint.Join.ROUND
mPaint!!.strokeCap = Paint.Cap.ROUND
mPaint!!.strokeWidth = mStrokeWidth
mPaint!!.alpha = 0