一、
这个简单的键-值对添加到您的Info.plist:UIViewEdgeAntialiasing设置为YES。但是这样容易出现性能问题。
二、
对单个 Layer 开启抗锯齿的方法, imageView.layer.allowsEdgeAntialiasing = YES; //>=ios7
三、
image的category
- (UIImage *)antiAlias
{
CGFloat border = 1.0f;
CGRect rect = CGRectMake(border, border, self.size.width-2*border, self.size.height-2*border);
UIImage *img = nil;
UIGraphicsBeginImageContext(CGSizeMake(rect.size.width,rect.size.height));
[self drawInRect:CGRectMake(-1, -1, self.size.width, self.size.height)];
img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
UIGraphicsBeginImageContext(self.size);
[img drawInRect:rect];
UIImage* antiImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext