第一次接触的可以看一下这个,最基础的画图https://blog.csdn.net/hanmoliuxuan/article/details/82490762
图片
代码
准备工作
public static int j[]={
0,2,2,2,4,2,2,6,2,9,2};
Draw1 draw1;
int i=0;
public Draw1(Context context, AttributeSet attrs) {
super(context, attrs);
draw1=(Draw1) findViewById(R.id.draw1);
handler.postDelayed(runnable, 100);
}
Handler handler=new Handler();
Runnable runnable=new Runnable() {
@Override
public void run() {
handler.postDelayed(this, 1000);
i++;
if (i>10)
{
i=0;
Newpoints()