I want to draw a view like the picture above,but I'm stuck in how to draw the outline, I can only draw a circle, I cannot add two ears ,so someone can help me, I also want to draw a progress.
Asked
Active
Viewed 45 times
0
-
You can use `Path` to draw lines. – mr.icetea Sep 20 '15 at 09:34
1 Answers
1
Draw line it just
@Override
public void onDraw(Canvas canvas) {
//canvas.drawLine(sx, sy, fx, fy, paint);
canvas.drawLine(20, 0, 0, 20, paint);
}
If you are asking how to draw an arc, then you really need to use the Path. or this code:
canvas.drawColor(Color.CYAN);
Paint p = new Paint();
p.setAntiAlias(true);
p.setColor(Color.RED);
p.setStyle(Paint.Style.STROKE);
p.setStrokeWidth(5);
RectF rectF = new RectF(50, 20, 100, 80);
canvas.drawOval(rectF, p);
p.setColor(Color.BLACK);
canvas.drawArc (rectF, 90, 45, true, p);

Community
- 1
- 1

user2413972
- 1,355
- 2
- 9
- 25
-
-
-
-
http://code.tutsplus.com/tutorials/android-sdk-create-a-drawing-app-touch-interaction--mobile-19202 – user2413972 Sep 20 '15 at 13:59