android在SurfaceView上翻译ImageView

Kar*_*rol 6 animation android surfaceview imageview translate-animation

我有两个小部件,ImageView和SurfaceView.

SurfaceView包含相机预览.有时候我必须在SurfaceView上显示Bitmap(我使用ImageView来显示这个图像).没关系.但是,我还必须翻译这个位图.当我开始动画时,ImageView消失了.

我使用TranslateAnimation:

TranslateAnimation slide = new TranslateAnimation(fromX, toX, fromY, toY);
slide.setDuration(1000);
slide.setFillAfter(true);
image.startAnimation(slide);

我想知道,为什么ImageView会消失以及如何修复它.有人解决了类似的问题吗?