1.在iOS 11以后,UIBarButtonItem设置customView,如果包含image,会自动改变大小和图片一致,为了防止这个现象,需要把图片按照需要的尺寸重画
//用if进行判断
if ([UIDevice currentDevice].systemVersion.floatValue >= 11.0f){}
进行画图的时候,会出现图片模糊,需要注意一个函数
UIGraphicsBeginImageContext(CGSize size) //模糊图片
UIGraphicsBeginImageContextWithOptions(size, NO, 0.0);//清晰图片
[image drawInRect:CGRectMake(0, 0, size.width, size.height)];
UIImage* resultImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();