The code for drawing an arrow with Style: Fill is given below:
paint.setColor(Color.parseColor("#bdc0dc"));
paint.setStyle(Style.FILL);
canvas.drawPath(arrowPath, paint);
paint.setColor(Color.BLACK);
paint.setStyle(Style.STROKE);
paint.setStrokeWidth(2);
canvas.drawPath(arrowPath, paint);
And the output I obtain is this :
Now what I want do is set style to Gradient(Style.gradient not present in android...) to obtain the arrow similar to the image given below :
How do i do it ? I tried adding style in style.xml but was unable to add gradient there as it accepts item as parameter..
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…