CGAffineTransformMakeRotation(90);如何將值從uitextfield傳遞給CGAffineTransformMakeRotation
我如何發送mytextfield.text到CGAffineTransformMakeRotation ,如:CGAffineTransformMakeRotation(mytextfield.text);
CGAffineTransformMakeRotation(90);如何將值從uitextfield傳遞給CGAffineTransformMakeRotation
我如何發送mytextfield.text到CGAffineTransformMakeRotation ,如:CGAffineTransformMakeRotation(mytextfield.text);
你只需要將字符串轉換爲數字。
CGAffineTransformMakeRotation([mytextfield.text floatValue]);
#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
對於任何人的將來參考
您可能需要度轉換爲弧度爲好。 – kennytm 2010-07-02 14:21:41
也許他想要90弧度:) – 2010-07-02 14:24:49
對不起90度..不是弧度... – 2010-07-02 14:41:12