Android: draw arc within canvas api with a gradient fill color
问题 I want to draw an arc using canvas using a gradient fill. How can achieve this? 回答1: Hey I stole this from here: Draw an arc with a SweepGradient in Android but it works fine, I used a LinearGradient instead. Shader gradient = new SweepGradient (0,getMeasuredHeight()/2, Color.RED, Color.WHITE); lightRed.setShader(gradient); canvas.drawArc(rectf, -90, 360, false, lightRed); 回答2: In my cause i I had to draw someone like this: Maybe you too. So, let's think! How does Sweep Gradient works? If you