Animating Rotations on Views
To make your app stand out from the rest, you will need to give it a unique look and feel. Apple helps you a lot here, by making it easy to animate changes to views (which can include UILabel's, UIImageView's, UIButton's and much more). Some people may try to simulate animations using a timer and adjusting the changes over time, however this uses a lot of unnecessary resources and will certainly never be as smooth or easy as Apple's UIView animation resources. For example if I wanted to apply a 180 degree rotation on a view object, I would use the following code:
[UIView beginAnimations:nil context:nil]; [UIView setAnimationDuration:0.5]; viewObject.transform = CGAffineTransformMakeRotation((M_PI/180.0)*180.0); [UIView commitAnimations];
This would make the object spin 180 degrees during the course of 0.5 seconds. The same technique can be applied when making changes to an objects frame, this can make it zoom across the screen or shrink/grow in an animated fashion, or combine all rotation, size and position for some neat effects.
Now something else to notice is the way I have applied the rotation code. It's important to acknowledge that the CGAffineTransformMakeRotation takes inputs as radians (where Pi is equal to 180 degrees), so we will need to convert a standard degree to a radian if we want to use them as inputs.
Thanks,
For help in the animation.
Please give the way how can we make speedometer in iphone Without using open GL