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 に答える