How to set gradient style to paint object?

前端 未结 2 1620
醉话见心
醉话见心 2020-12-04 17:52

The code for drawing an arrow with Style: Fill is given below:

paint.setColor(Color.parseColor(\"#bdc0dc\"));
paint.setStyle(Style.FILL);
canvas.dr         


        
2条回答
  •  青春惊慌失措
    2020-12-04 18:09

    use the code below..

    paint.setShader(new LinearGradient(0, 0, 0, getHeight(), Color.BLACK, Color.WHITE, Shader.TileMode.MIRROR));
        canvas.drawPath(arrowPath, paint);
    

提交回复
热议问题