[我想要一个具有一定阴影和拐角半径的视图,当我有阴影时,我遇到的问题是拐角半径不可用,我将masktobound设置为false并添加了此代码]
func setShadow() {
cardCBView.layer.cornerRadius = 10
cardCBView.layer.borderWidth = 1.0
cardCBView.layer.borderColor = #colorLiteral(red: 0.8980392157, green: 0.8980392157, blue: 0.8980392157, alpha: 0)
cardCBView.layer.shadowColor = UIColor.black.cgColor
cardCBView.layer.shadowOffset = CGSize.zero
cardCBView.layer.shadowOpacity = 0.2
cardCBView.layer.shadowRadius = 4.0
}
我如何获得阴影和半径角?
感谢您的任何帮助
clipsToBounds = true