0

我在我的应用程序启动时在 ImageView 上做一个旋转动画。

然后稍后在应用程序中的一个事件上,我想用相同的 ImageView 做一个淡出动画。

这有效,但在它执行淡出动画之前,它将 ImageView 状态恢复到旋转动画之前。

所以它跳回到“未旋转”状态,然后淡出。

是否可以在第一次旋转后保持 ImageView 的动画状态并从那里继续淡出动画?

4

2 回答 2

0

好的,我猜我必须使用矩阵旋转而不是动画:

ImageView circle = (ImageView) findViewById(R.id.imageView1);
Bitmap myImg = BitmapFactory.decodeResource(getResources(), R.drawable.rotated);

Matrix matrix = new Matrix();
matrix.postRotate(45);

Bitmap rot = Bitmap.createBitmap(myImg, 0, 0, myImg.getWidth(), myImg.getHeight(),
        matrix, true);

circle.setImageBitmap(rot);  
于 2013-02-12T22:17:05.247 回答
0

Just because you animate something doesn't mean you have changed it permanently (see previous discussion). You may want to modify the onAnimationEnd() method to make the effect of your first animation permanent before starting another animation.

于 2013-02-12T16:07:09.887 回答