//在图片边缘添加一个像素的透明区域,去图片锯齿
CGRect imageRrect = CGRectMake(0, 0,imageView.frame.size.width, imageView.frame.size.height);
UIGraphicsBeginImageContext(imageRrect.size);
[imageView.imagedrawInRect:CGRectMake(1,1,imageView.frame.size.width-2,imageView.frame.size.height-2)];
imageView.image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
消除锯齿:
imageView.layer.shadowOffset = CGSizeMake(0, 2);//0,2
imageView.layer.shadowRadius = 2.0;
imageView.layer.shadowColor = [UIColor whiteColor].CGColor;
imageView.layer.shadowOpacity = 0.8;
imageView.layer.borderColor = [UIColor whiteColor].CGColor;
imageView.layer.borderWidth = 3.0;//2.0
imageView.layer.cornerRadius = 3.0;//3.0
imageView.layer.masksToBounds=YES;
[imageView.layer setShouldRasterize:YES];