views:

99

answers:

2

How can i display a simple animation?

Let's say there is a button on the screen with margin left of 200, and margin top of 200. I need to set the margin left, and top of this button to 0 and show a simple animation.

So basically a simple animation on a button from position 200,200 to position 0,0

+1  A: 

Use a TranslateAnimation.

CommonsWare
+3  A: 

There are mainly 4 built-in Animations comes up with Android SDK:

  1. AlphaAnimation – transparency changes
  2. RotateAnimation – rotations
  3. ScaleAnimation – growing or shrinking
  4. TranslateAnimation – position changes

So from these....You can implement TranslateAnimation.

You can refer Example here and also Android SDK - TranslateAnimation .

Enjoy!!!

PM - Paresh Mayani