实现效果图:
想要实现上述效果,非常的简单,我在这里就直接用代码给大家讲解了:
首先我们要写一个圆的类:
package com.example.android19_zhangkai_pointstouch;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import java.util.Random;
/**
* Created by Administrator on 2017/7/9 0009.
*/
public class Circle {
public float x;
public float y;
public int r=100;
public int pointId;
//随机三原色
int red;
int green;
int blue;
Random random=new Random();
public Circle(float x, float y, int pointId){
this.x = x;
this.y = y;
this.pointId = pointId;
red=random.nextInt(255);
green=random.nextInt(255);