I want a view with some shadow and corner radius the problem i have when i have shadow the corner radius is not available i set masktobound to false and i have added this code
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
}
i have result like image : with masktobound off
when i put different color for bordercolor
how can i have shadow and radius corner ?
any help is appreciated
There are three steps through which you can achieve both shadow and corers
clipToBounds = true
clipToBounds = false