2010-07-02 86 views

回答

1

你只需要将字符串转换为数字。

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

您可能需要度转换为弧度为好。 – kennytm 2010-07-02 14:21:41

+1

也许他想要90弧度:) – 2010-07-02 14:24:49

+0

对不起90度..不是弧度... – 2010-07-02 14:41:12

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]; 


} 

那我怎么从弧度转换为度CGAffineTransformMakeRotation

对于任何人的将来参考