iOS 技术分享

iOS - view添加阴影边框

2020-04-07  本文已影响0人  Joh蜗牛

给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;

效果如图:


阴影边框
上一篇 下一篇

猜你喜欢

热点阅读