On an iOS 14 device compiled with XCode 12 an extra UITableViewCellContentView is appearing above the content of the table view preventing any of the buttons underneath it from being tapped. This only appears in iOS 14. It does not appear in iOS 13. Any ideas on how to remove it?
You have to add your views to cell contentView like this:
contentView.addSubview(button)
and anchor your button to contentView:
button.topAnchor.constraint(equalTo: contentView.topAnchor).isActive = true
If your project is big and it's hard to change every addSubview
to contentView.addSubview
, you can add this extension to your project:
extension UITableViewCell {
open override func addSubview(_ view: UIView) {
super.addSubview(view)
sendSubviewToBack(contentView)
}
}
Had the same issue, we did this :
sendSubviewToBack(contentView)
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