我正在使用
[@"mytext" drawInrect : CGRrectIntegral (rect) withFont:font];
在图片上写文字,我怎样才能每次用不同的角度写文字? (它的滚动图片应与文本一起旋转)。
答案 0 :(得分:0)
下面的代码会旋转label
- (IBAction)rotate:(id)sender {
CGContextRef context = UIGraphicsGetCurrentContext();
[UIView beginAnimations:nil context:context];
[UIView setAnimationDuration:0.5];
[UIView setAnimationDelegate:self];
[UIView setAnimationDidStopSelector:@selector(endAnimation)];
CGAffineTransform rotate = CGAffineTransformMakeRotation(90.0f * (M_PI / 180.0f));
self.label.transform = rotate;
[UIView commitAnimations];
}