我有多条线在不同的位置绘制。例如:
canvas.drawLine(startXLine1 ,stopXLine1, startYLine1, stopYLine1, paint)
canvas.drawLine(startXLine2 ,stopXLine2, startYLine2, stopYLine2, paint)
我希望每行都有如下渐变效果:
![enter image description here](https://istack.dev59.com/tSuLr.webp)
Shader shader = new LinearGradient(startXLine1, startYLine1, stopXLine1, stopYLine1, res.getColor(R.color.blue), res.getColor(R.color.white), Shader.TileMode.CLAMP);
paint.setShader(shader);
有人能帮我解决这个问题吗?
h
不为零,或者发布您传递的坐标。 - bonnyz