iOS8使用UIVisualEffectView实现模糊效果
- (
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];
}