想做一个拼图游戏,已经实现了全部功能,通过二维数组保存9张图片,
交换完相邻图片后,调用setContentView(imageLayout);现在想在交换两张图片的时候加上animation动画,
Animation animation1 = new TranslateAnimation(0, animation_1_to2x, 0,animation_1_to2y);
animation1.setDuration(200);
imageViewArray[f.x][f.y].setAnimation(animation1);
imageViewArray[f.x][f.y].startAnimation(animation1);动画函数已经测试过没有问题,但加上后并没有动画效果,我认为是程序并不等待动画效果完成,而是很快向后执行交换图片,再执行setContentView(imageLayout);我想问问有没有什么函数能让线程等待一段时间待动画完成,再向后执行?