views:

28

answers:

2

Hello all, i am developing app for my iphone most of her was completed. now i want to add another button but i want it to be spaciel button. the shap of the button will be like radar screen and when i press it i want from the button to spin around.

can someone help me with guidlines.

thanks

A: 

Use transform property of you UIButton to translate, rotate or scale its ;-) As Adam Ebernach said, a UIButton is a UIView so you can do all same animation with UIView and UIButton :-)

Human-Behind
A: 

You can try this

CABasicAnimation *spinbuttonAnime; spinbuttonAnime = [CABasicAnimation animationWithKeyPath:@"transform.rotation"]; spinbuttonAnime.fromValue = [NSNumber numberWithFloat:0]; spinbuttonAnime.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)]; spinbuttonAnime.duration = 0.5; spinbuttonAnime.repeatCount = 1; [myButton addAnimation:spinbuttonAnime forKey:@"180"];

Pras
thanks for the help,does there is more property for transform. ??
Amir