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