我正在使用矩阵来转换/缩放ImageView,在setImageMatrix之后,结果直接显示,有没有办法使其动画化呢?
谢谢!
谢谢!
放大会是平移和缩放的结合:
// zooms in to the center of the screen
mZoomIn = new AnimationSet(true);
mTranslate = new TranslateAnimation(
Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, -imageViewXCoord/(mScreenWidth/mImageViewWidth),
Animation.ABSOLUTE, 0.0f, Animation.ABSOLUTE, -imageViewYCoord/(mScreenWidth/mImageViewWidth)
);
mTranslate.setDuration(200);
mScale = new ScaleAnimation(1, mScreenWidth/mImageViewWidth, 1, mScreenWidth/mImageViewWidth);
mScale.setDuration(200);
mZoomIn.addAnimation(mTranslate);
mZoomIn.addAnimation(mScale);
mZoomIn.setFillAfter(true);
mZoomIn.setFillEnabled(true);
mImageView.startAnimation(mZoomIn);
mZoomIn.setInterpolator(new ReverseInterpolator())