view添加毛玻璃效果两种方法
第一种方法:
UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect]; effectView.alpha = 0.9; effectView.frame = CGRectMake(0, 0, bgImageView.frame.size.width, bgImageView.frame.size.height); [bgImageView addSubview:effectView];
第二种方法:
UIToolbar *toolbar = [[UIToolbaralloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT)]; toolbar.barStyle = UIBarStyleDefault; [_backImg addSubview:toolbar];