我最开始设置的是
_meTView.tableHeaderView = [[UIView alloc] init];
不起作用,然后再改为
_meTView.sectionHeaderHeight = 0.1f;
依然不起作用,
再尝试实现设置头部section高度的代理
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
return 0.0f;
}
也不起作用,在尝试设置inset属性
_meTView.contentInset = UIEdgeInsetsMake(<#CGFloat top#>, <#CGFloat left#>, <#CGFloat bottom#>, <#CGFloat right#>)
有效果,最后我又尝试了最后一种方法
_meTView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, 0.1)];
可行,进过对边选择了最后一个方法,原因本人之前习惯隐藏底部空白使用
_meTView.tableFooterView = [[UIView alloc] init];
至于为何使用
_meTView.tableHeaderView = [[UIView alloc] init];
不起作用,至于为啥,我也很想知道
网友评论