美文网首页
tableView设置UITableViewStyleGroup

tableView设置UITableViewStyleGroup

作者: 我一不小心就 | 来源:发表于2018-07-27 16:24 被阅读0次

我最开始设置的是

_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];

不起作用,至于为啥,我也很想知道

相关文章

网友评论

      本文标题:tableView设置UITableViewStyleGroup

      本文链接:https://www.haomeiwen.com/subject/nodgmftx.html