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,257
  • 4
  • 26
  • 39
Viktor Kucera
  • 6,177
  • 4
  • 32
  • 43

0 Answers0