/ UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark]; UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; // UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight]; UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect]; [self.view addSubview:effectView]; effectView.frame = imageView.frame; effectView.alpha = 0.98; UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem]; btn.frame = CGRectMake(10, 50, 100, 40); [btn setTitle:@"btn" forState:UIControlStateNormal]; [effectView.contentView addSubview:btn];
代碼效果:git
iOS8之後 能夠使用UIVisualEffectView製做毛玻璃效果, 性能也是很是高的, iOS7時候能夠使用下面的一個框架, 很簡單的框架愛. https://github.com/justinmfischer/7blurgithub