美文网首页
毛玻璃效果

毛玻璃效果

作者: c_f | 来源:发表于2017-06-16 14:11 被阅读0次
    /*
         毛玻璃的样式(枚举)
         UIBlurEffectStyleExtraLight,
         UIBlurEffectStyleLight,
         UIBlurEffectStyleDark
         */
        UIImage* image = [UIImage imageNamed:@"agendaDefaultImg1001"];
        UIImageView *bgImgView = [[UIImageView alloc] initWithFrame:CGRectMake((self.view.frame.size.width-image.size.width)/2.0, (self.view.frame.size.height-image.size.height)/2.0, image.size.width, image.size.height)];
        bgImgView.image = image;
        [self.view addSubview:bgImgView];
        
        UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
        UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect];
        effectView.frame = CGRectMake(0, 0, bgImgView.frame.size.width, bgImgView.frame.size.height);
        [bgImgView addSubview:effectView];
    

    相关文章

      网友评论

          本文标题:毛玻璃效果

          本文链接:https://www.haomeiwen.com/subject/funyqxtx.html