Reputation: 13975
I have a UITableView that is kind of floating, and has rounded corners and a set height. But I want to add a shadow too it, but my problem is I need to have clipsToBounds
turned on so my cells don't go outside of the floating UITableView.
Is there anyway to add a shadow while keeping clipsToBounds turned on for a UITableView?
Upvotes: 1
Views: 1249
Reputation: 37290
I'd recommend putting the UITableView
within a UIView
of the same size so you can maintain clipsToBounds
on the UITableView
but give that UIView
superview the shadow so it looks as if the UITableView
subview is casting that shadow.
Upvotes: 1