我想开发类似下图的应用程序
我想将图像视图2,3,4,5,6设置为imageview 1,反之亦然
请任何人帮我解决这个问题
答案 0 :(得分:2)
int distance = 100; //the distance to move in pixels
int duration = 500; //the duration of the animation in ms
double direction = Math.random() * 2 * Math.PI;
int translationX = Math.cos(direction) * distance;
int translationY = Math.sin(direction) * distance;
yourImageView.animate().translationX(translationX).translationY(translationY).setDuration(duration).start();