Q:

iPhone sdk basic element\button animation

I just wanna know if there exists simple drawer (move up and down certain pixels)like animation for generic iPhone button as animated action or not?
How one can approach to implement that.
Can someone guide me.Thanks for your effort in advance.

A:

The animation system in cocoa-touch is very powerful. You only need to create an animation block where you set the values you want animated. For example, taking your button and moving it would be as simple as assigning the new position to it and triggering the animation:
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];

//modify any animatable property (scale, position, tranparency, etc)
yourButton.center = CGPointMake(newX, newY);

[UIView commitAnimations];

Now this is the simplest way to animate, but there is a lot that you can control. You can change the animation curb, ask the animation to call you back when it's finished, etc.
If you have access to the 2010 wwdc conference presentations (every registered developper can view them), there is one presentation dedicated to animation on the iphone: look for Session 123. Time well invested.

