iOS8使用UIVisualEffectView实现模糊效果

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

    - (void)viewDidLoad {  
        [super viewDidLoad];  
        // Do any additional setup after loading the view, typically from a nib.  
        //使用图片初始化背景色  
        self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"gradient2"]];  
        //实现模糊效果  
        UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];  
        visualEffectView.frame = self.view.bounds;  
        visualEffectView.alpha = 1.0;  
        [self.view addSubview:visualEffectView];  
    }