0
点赞
收藏
分享

微信扫一扫

JavaScript中的交互的方式alert,prompt,confirm的用法

eelq 2023-08-12 阅读 53
ios

效果图
请添加图片描述
用到了 UIVisualEffectView

实现代码

- (UIVisualEffectView *)bgEffectView{
    if(!_bgEffectView){
        UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
        _bgEffectView = [[UIVisualEffectView alloc] initWithEffect:blur];
    }
    return _bgEffectView;
}

将 bgEffectView 盖到imageview上面即可

- (UIImageView *)bannerView
{
    if (!_bannerView) {
        _bannerView = [[UIImageView alloc] init];
        _bannerView.backgroundColor = [UIColor redColor];
    }
    return _bannerView;
}

- (UIVisualEffectView *)bgEffectView{
    if(!_bgEffectView){
        UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
        _bgEffectView = [[UIVisualEffectView alloc] initWithEffect:blur];
    }
    return _bgEffectView;
}


   [self addSubview:self.bannerView];
    [self addSubview:self.bgEffectView];
举报

相关推荐

0 条评论