在IOS8之前,要是一个背景产生毛玻璃效果,我们只能借用第三方的类,现在在IO8中,苹果给出了相关的接口,能直接让你做出毛玻璃效果,毛玻璃效果本质上就是一个View,
//初始化一个visualEffectView试图,参数为UIVisualEffect
//UIBlurEffect为UIvisualEffect子类
UIBlurEffect * blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView * visualEffectView = [[UIVisualEffectView alloc]initWithEffect:blurEffect];
//设定frame
visualEffectView.frame = CGRectMake(300,300,300, 300);
[self.view addSubview:visualEffectView];
/**
//将visualEffectView添加到imageView上
UIImageView * imageView = [[UIImageView alloc]initWithFrame:CGRectMake(300, 300, 300, 300)];
imageView.center = self.view.center;
imageView.image = [UIImage imageNamed:@"1.jpg"];
[self.view addSubview:imageView];
[imageView addSubview:visualEffectView];
**/