不用点击事件控制?定义一个初始化方法,在方法内通过循环加线程睡眠的方式让图片随机移动。
while (true) { try { //图片移动代码 Thread.sleep(1000); } catch (InterruptedException e) { e.printStackTrace(); } }
自定义View,用drawBitmap可以实现