美文网首页iOS tableview
iOS-_tableView.estimatedSectionF

iOS-_tableView.estimatedSectionF

作者: Simple_Code | 来源:发表于2018-07-05 10:01 被阅读56次

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

*** 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
}

相关文章

  • iOS-_tableView.estimatedSectionF

    项目在真机上测试一直没问题、今天在手机上运行一直报下面错误 查阅相关资料发现是下面代码导致的 希望遇见这个问题的你...

网友评论

    本文标题:iOS-_tableView.estimatedSectionF

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