Reputation: 1464
I have a VC that has a UITableView
all over the screen, except the first 66px from the top. There, I have a custom UIView
I call "Toolbar" which contains a title and a button.
It looks like this:
I'm trying to add a shadow to the "Toolbar" that will be visible on top of the UITableView
. I'm adding it like this:
For some reason, I don't see any shadow when I run the app.
What am I doing wrong? Does anybody know?
Thank you!
Upvotes: 0
Views: 792
Reputation: 2222
Shadow needs some spaces to be shown, you have to add some vertical spaces between your top view(toolbar) and the Table view.
for having a result like the following:
ans I also use the following code for adding the shadow:
toolbar.layer.shadowColor = UIColor.black.cgColor
toolbar.layer.shadowOpacity = 1
toolbar.layer.shadowOffset = CGSize.zero
toolbar.layer.shadowRadius = 10
toolbar.layer.masksToBounds = false
Upvotes: 1