2010-07-02 9 views

Répondre

1

Vous avez juste besoin de convertir la chaîne en nombre.

CGAffineTransformMakeRotation([mytextfield.text floatValue]); 
+1

Vous devrez peut-être convertir des degrés en radians ainsi. – kennytm

+1

Peut-être qu'il voulait 90 radians :) –

+0

Désolé 90 degrés .. pas radians ... –

1
#define DEGREES_TO_RADIANS(__ANGLE__) ((__ANGLE__)/180.0 * M_PI) 

-(IBAction)RotateButtonPressed:(id)sender; 
{ 
    [UIView beginAnimations:nil context:NULL]; 
    [UIView setAnimationDuration:1.5]; 
    arrow.center = CGPointMake(151.0,80.0); 
arrow.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS([degrees.text floatValue])); 
    [UIView commitAnimations]; 


} 

est comment je ne convertir de radians en degrés pour CGAffineTransformMakeRotation

Pour anyones référence future

Questions connexes