How to Rotate or Scale ImageView with Image?
How to Rotate or Scale Image View with Image? Imag开发者_JAVA百科e View's Size is Wrap_Content and Rotate or Scale Image on Touch Event Of Image view.
Please Help Me.
You can use Animation
on your ImageView. Here is an example for rotate animation:
Animation anim = new RotateAnimation(0, ANGLE, Animation.RELATIVE_TO_SELF, 0.5f, Animation.RELATIVE_TO_SELF, 0.5f);
anim.setDuration(DURATION);
anim.setRepeatCount(0);
anim.setFillAfter(true);
image_view.startAnimation(anim);
You can find similar solution for Scale and Translate animation. If you don't want to see animation, set duration to zero. The setFillAfter
is important, if you dont want to reset the image after animation. Good luck
精彩评论