给view添加阴影

-(UIView *)vBG{
    if (!_vBG) {
        _vBG = [XWTool viewbackground:Color_White SuperView:self.contentView];
        _vBG.layer.cornerRadius = 6;
        _vBG.layer.backgroundColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0].CGColor;
        _vBG.layer.shadowColor = [UIColor colorWithRed:218/255.0 green:218/255.0 blue:218/255.0 alpha:1.0].CGColor;
        _vBG.layer.shadowOffset = CGSizeMake(0,3);
        _vBG.layer.shadowOpacity = 1;
        _vBG.layer.shadowRadius = 14;
    }
    return _vBG;
}```

猜你喜欢

转载自blog.csdn.net/weixin_42050662/article/details/122734488