Use third-party libraries FXBlurView and iosfxblurview for iOS blur Effects
Fuzzy effect. Using FXBlurView, a third-party library, you can easily implement this function.
Effect:
The following figure shows the implementation of ViewController. m.
#import "ViewController.h"#import "FXBlurView.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. UIImage *im = [UIImage imageNamed:@"changmen.jpg"]; UIImageView *imageView = [[UIImageView alloc] initWithImage:im]; imageView.frame = CGRectMake(0, 0, im.size.width, im.size.height); [self.view addSubview:imageView]; FXBlurView *fxView = [[FXBlurView alloc] initWithFrame:CGRectMake(50, 0, 200, 200)]; fxView.dynamic = NO; fxView.blurRadius = 40; fxView.tintColor = [UIColor clearColor]; [self.view addSubview:fxView]; }
Code download: http://pan.baidu.com/s/1o64w1YE