【发布时间】:2013-09-26 09:45:01
【问题描述】:
我正在渲染多个图层以获得最终图像。其中一张图片包含一张脸,另一张图片包含背景,脸部周围有透明渐变,因此隐藏了真实背景。在 iOS6 中它可以完美运行,但它在 iOS7 中使用透明渐变创建了一种奇怪的效果。
代码:
CGRect rect = [[UIScreen mainScreen] bounds];
UIGraphicsBeginImageContext(rect.size);
CGContextRef context = UIGraphicsGetCurrentContext();
[faceImageView.layer renderInContext:context];
[fakeBackgroundImageView.layer renderInContext:context];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
iOS6和iOS7中的结果:
【问题讨论】:
标签: ios6 ios7 calayer uigraphicscontext