@IBOutlet weak var selectorSemiView: UIView!
@IBOutlet weak var blurEffect: UIVisualEffectView!
@IBOutlet var outerAreaRecognizer: UITapGestureRecognizer!
override func viewDidLoad() {
super.viewDidLoad()
selectorSemiView.layer.cornerRadius = 15
selectorSemiView.layer.shadowColor = UIColor.gray.cgColor
selectorSemiView.layer.shadowOffset = CGSize.zero
selectorSemiView.layer.shadowRadius = 7
}
selectorSemiView is a container view
When I run this app, there is no shadow and no rounded corner.
What's wrong in my code?
your code is fine but you forget to set the opacity, if you need the more information you can get the another answer in SO, for e.g
selectorSemiView.layer.cornerRadius = 15
selectorSemiView.layer.shadowColor = UIColor.gray.cgColor
selectorSemiView.layer.shadowOffset = CGSize.zero
selectorSemiView.layer.shadowOpacity = 1.0
selectorSemiView.layer.shadowRadius = 7.0
selectorSemiView.layer.masksToBounds = false
output
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With