美文网首页iOS 技术分享
iOS - view添加阴影边框

iOS - view添加阴影边框

作者: Joh蜗牛 | 来源:发表于2020-04-07 16:47 被阅读0次

给view添加阴影边框的代码:

    self.contentBackView.layer.shadowColor = RGBA(204, 204, 204, 1).CGColor;
    // 阴影偏移,默认(0, -3)
    self.contentBackView.layer.shadowOffset = CGSizeMake(0,0);
    // 阴影透明度,默认0
    self.contentBackView.layer.shadowOpacity = 0.5;
    // 阴影半径,默认3
    self.contentBackView.layer.shadowRadius = 5;

效果如图:


阴影边框

相关文章

网友评论

    本文标题:iOS - view添加阴影边框

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