android 画虚线,虚线圆

Paint paint = new Paint();
paint.setAntiAlias(true);
paint.setStyle(Paint.Style.STROKE);  
paint.setColor(Color.BLUE);
PathEffect effects = new DashPathEffect(new float[]{5,5,5,5},1);  
paint.setPathEffect(effects);
canvas.drawCircle(202, 202, 100, paint);
canvas.drawLine(0, 0, 400, 400, paint);
posted @ 2016-08-15 16:13  北京刘星  阅读(2560)  评论(0编辑  收藏  举报