iOS-_tableView.estimatedSectionFooterHeight = 0.01f的坑

项目在真机上测试一直没问题、今天在手机上运行一直报下面错误

*** Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3599.6/UITableViewRowData.m:465

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'section footer height must not be negative - provided height for section 0 is -0.010000'

查阅相关资料发现是下面代码导致的

_tableView.estimatedSectionFooterHeight = 0.01f;这行代码导致的
- (CGFloat) tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0.01;//设置尾视图高度为0.01
}

希望遇见这个问题的你快速找到问题答案

提供tableViewSectionHeader、Footer高度为0的设置

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 0.01f;//CGFLOAT_MIN
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
    return 0.01f;//CGFLOAT_MIN
}
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 177,227评论 25 709
  • 十三年了,他回来了,一身病骨,看起来分外单薄,音容全改,竟无一丝往日痕迹,一裘白衣,倒也不失清雅的气质。他知道,...
    矢车菊阅读 7,251评论 7 22
  • 今天上午在三班上课时因为去的早在离上课两分钟时就立到了讲台上,喊了私起立。结果遭到了某些同学反对。以后到点再去吧。...
    美丽心情赵雪阅读 1,184评论 0 0
  • windows环境下 生成公钥和私钥 上传代码到远程仓库的时候需要秘钥进行验证是否本人上传的。打开Git目录下的G...
    HelloMoney_0ff4阅读 3,865评论 0 2

友情链接更多精彩内容