0

可能重复:
如何以一定角度绘制 NSString?

我在用

[@"mytext" drawInrect : CGRrectIntegral (rect) withFont:font];

在图片上写文字,我怎样才能每次用不同的角度写文字?(它应该与文本一起旋转的滚动图片)。

4

1 回答 1

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];  
}
于 2012-08-05T08:24:32.460 回答