android 自定义曲线图

来源:互联网 发布:益阳长春淘宝客服 编辑:程序博客网 时间:2024/05/18 03:01

效果图



使用到的类 canvas,path

path.moveTo() //可以理解为出发点

path.lineTo()//连接到指定的点

path.close()//形成闭环


主要代码

// co shadowif (i == 0) {coPath.moveTo(curX, originPointY);//coPath.lineTo(curX, curCo);}coPath.lineTo(curX, curCo);// current point(x,y)if(i==count-2){coPath.lineTo(curX, originPointY);coPath.lineTo(xWidth, originPointY);coPath.close();canvas.drawPath(coPath, coShadowPaint);}


0 0