图片上Tina及毛玻璃效果

2018-05-17  本文已影响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];

上一篇下一篇

猜你喜欢

热点阅读