美文网首页
图片上Tina及毛玻璃效果

图片上Tina及毛玻璃效果

作者: 梁苏珍 | 来源:发表于2018-05-17 11:38 被阅读0次

        UIImageView *backgroundView = [[UIImageView alloc] init];

        [backgroundViewsd_setImageWithURL:[NSURL URLWithString:self.strTopImageView] placeholderImage:[UIImage imageNamed:@"devotion_bannerB"]];

        backgroundView.frame=CGRectMake(0,0,ScreenWidth,180);

        backgroundView.contentMode = UIViewContentModeScaleAspectFill;

        backgroundView.userInteractionEnabled=YES;

        [self.viewaddSubview:backgroundView];

    //添加毛玻璃效果

        UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];

        UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:effect];

        effectView.frame=CGRectMake(0,0, backgroundView.frame.size.width*1.0, backgroundView.frame.size.height);

        effectView.alpha=0.7;

        [backgroundViewaddSubview:effectView];

    相关文章

      网友评论

          本文标题:图片上Tina及毛玻璃效果

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