在用户使用过程中是发现不了白边的,只有在使用系统的api进行view的截图的时候,两个ImageView图片拼接的地方,有白边存在。这两张背景图片均为jpg,没有半透明。而且,在Photoshop中也检查过图片拼接情况,没有白边。但是有时候在iPhone4上又没有白边,在6 Plus上就有。非常奇怪!请有经验的同学给点思路,谢谢!
以下是截图代码:
- (UIImage*)capturePhoto
{
//支持retina高分的关键
if (UIGraphicsBeginImageContextWithOptions != NULL) {
UIGraphicsBeginImageContextWithOptions(self.view.frame.size, NO, 0.0);
} else {
UIGraphicsBeginImageContext(self.view.frame.size);
}
//获取图像
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage* image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
There is nothing wrong with the screenshot code and can be eliminated.
I think the layout code should be carefully checked. It may be that the adaptation is not done well.