开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜