Home > Software design >  How do I get rid of this extra padding above each section in my table view that appeared in iOS 15?
How do I get rid of this extra padding above each section in my table view that appeared in iOS 15?

Time:09-16

I'm currently going through my app in the iOS 15 Beta to make sure all of the UI is looking good and I found that on one of my table views, there are now thick white lines above each section that were not present prior to iOS 15. As a result, not all of the sections fit on the table view (and, of course, it's also an eyesore). Has anyone else encountered this when checking out iOS 15? If so, have you found a fix for this issue?

enter image description here

CodePudding user response:

Ok, I figured it out. It's a one-line fix:

self.tableView.sectionHeaderTopPadding = 0.0f;

CodePudding user response:

if #available(iOS 15.0, *) {
    self.tableView.sectionHeaderTopPadding = 0.0
}
  • Related