在iOS7中折叠单元格时,表视图崩溃

时间:2014-02-26 09:21:23

标签: uitableview ios7

在iOS7中折叠单元格时,表视图崩溃,并显示错误消息:

- Assertion failure in -[UIViewAnimation initWithView:indexPath:endRect:endAlpha:startFraction:endFraction:curve:animateFromCurrentPosition:shouldDeleteAfterAnimation:editing:]

- 'Cell animation stop fraction must be greater than start fraction'. 

如何解决这个问题?

3 个答案:

答案 0 :(得分:6)

我有同样的问题。尝试在以下方法中返回0而不是其他任何东西,它不会再崩溃。

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

希望这有帮助。

答案 1 :(得分:1)

我遇到了同样的问题。

在iOS7上出现这种崩溃的事情很少

  • UITableViewStyle

  • 头/ footerViewHeight

来解决这个问题:

你可以尝试一下:

之一:

    - (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:UITableViewStyleGrouped];
    if (self)
    {

    }
    return self;
}

2:

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

- (CGFloat) tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return CGFLOAT_MIN;
}

答案 2 :(得分:0)

这似乎是一个错误。我发现将表格样式更改为分组会停止崩溃:

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:UITableViewStyleGrouped];
    if (self) 
    {

    }
    return self;

}

或者,您可以更改故事板中的石碑。

相关问题