2

I am trying to setup my own layoutMargins for UITableViewHeaderFooterView subclass. I have a header defined in a xib and loaded inside tableView(_:viewForHeaderInSection:). This is the snippet:

class SomeHeader: UITableViewHeaderFooterView {
    override func awakeFromNib() {
        super.awakeFromNib()
        layoutMargins = .zero
        contentView.layoutMargins = .zero
    }
}

It's still 20 points for any iPhone.

enter image description here

I am aware of problems with a root views. Is this the same problem? No way to customize than create my own contentView or something like that?

Assafs
  • 3,239
  • 4
  • 28
  • 36
Viktor Kucera
  • 6,029
  • 3
  • 31
  • 43

0 Answers0