sectionHeaderTopPadding
自iOS 15以来,UITableView有了一个sectionheadertoppadding的新属性,它指定每个Section Header上面的间隙Gap。
if ( @available(iOS 15.0, *)) {
_mainTable.sectionHeaderTopPadding = 0;
} else {
}
- alloc 之后 init 之前 调用某些方法会崩溃,比如:
CGFloat top = 88
self.contentInset = UIEdgeInsetsMake(self.contentInset.top, self.contentInset.left, top, self.contentInset.right)
- (instancetype)initWithFrame:(CGRect)frame style:(UITableViewStyle)style {
self = [super initWithFrame:frame style:style];
self.contentInset = .....等方法
return self;
}