美文网首页
UITableView容易忽略的问题

UITableView容易忽略的问题

作者: HAPPY小元宝 | 来源:发表于2016-08-11 17:27 被阅读18次

UITableViewController控制器中要改变tableView的模式:

  • 默认的就是UITableViewStylePlain
  • 生成UITableViewStyleGrouped:
  - (instancetype)init {
    return [self initWithStyle:UITableViewStyleGrouped];
}

当UITableView为UITableViewStyleGrouped模式时,底部会有空隙,此时设置:

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 0.01f;
}

即可解决此问题。
注意:不能设置为0.0f

相关文章

网友评论

      本文标题:UITableView容易忽略的问题

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