我目前在开发一个类似于iPhone上的简单Photoshop应用程序。当我想要将我的图层压缩时,标签的位置很好,但字体大小不正确。以下是我的压缩代码:
UIGraphicsBeginImageContext(CGSizeMake(widthDocument,widthDocument));
for (UILabel *label in arrayLabel) {
[label drawTextInRect:label.frame];
}
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
有谁能帮我吗?
UIGraphicsBeginImageContextWithOptions(self.bounds.size, self.opaque, 0.0);
如这个问题及其被接受的答案所示。也许您希望更新您的回答,包括该信息。 - anneblueUIGraphicsBeginImageContextWithOptions
中将不透明度设置为“NO”。 - Heberti Almeida