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];
posted @ 2018-04-02 09:44  chihbun  阅读(228)  评论(0编辑  收藏  举报