0
我已經旋轉的UILabel(用的UILabel變換):centerLabel.transform = CGAffineTransformMakeRotation((90 * M_PI)/180);
渲染的UILabel與變換
我需要渲染我的UILabel到UIImage的,但我不能使它與改造。當我渲染UILabel時,我得到了UILabel而沒有變換。我怎麼做到的?
這是我的方法:
+ (UIImage *) imageWithView:(UIView *)view andOpaque:(BOOL)opaque {
UIGraphicsBeginImageContextWithOptions(view.bounds.size, opaque, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}