@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
Paint paint = new Paint();
paint.setStyle(Paint.Style.STROKE);
paint.setColor(Color.DKGRAY);
Path path = new Path();
path.moveTo(0, 10);
path.lineTo(200, 10);
PathEffect effects = new DashPathEffect(new float[]{5,5,5,5},1);
paint.setPathEffect(effects);
canvas.drawPath(path, paint);
}
网友评论