Enlarge Animation

I use RotateAnimation for the image. But I also want to enlarge the image using animation. So when my image rotates, then the image also scales ...

How to zoom using rotation animation?

+6
android animation zoom
source share
3 answers

I have one idea, hope this helps.

 AnimationSet animSet = new AnimationSet(false); RotateAnimation rotate = new RotateAnimation(0, 180); ScaleAnimation zoom = new ScaleAnimation(0, 0, 1, 1); animSet.addAnimation(rotate); animSet.addAnimation(zoom); animSet.start(); 

You must change the settings as necessary.

+8
source share

In anim xml, you can work with a scale like this:

 <scale android:pivotX="50%" android:pivotY="50%" android:fromXScale=".1" android:fromYScale=".1" android:toXScale="1.0" android:toYScale="1.0" android:duration="2000" /> 
+11
source share

In Scale animation, called scale animation.

  ScaleAnimation scal=new ScaleAnimation(0, 1f, 0, 1f, Animation.RELATIVE_TO_SELF, (float)0.5,Animation.RELATIVE_TO_SELF, (float)0.5); scal.setDuration(500); scal.setFillAfter(true); ((ImageView)findViewById(R.id.logo)).setAnimation(scal); 
+7
source share

All Articles