【问题标题】:Weird Animation when inserting a row in UITableView在 UITableView 中插入行时出现奇怪的动画
【发布时间】:2010-05-15 16:01:13
【问题描述】:

当用户按下“编辑”时,我有一个包含数据列表的 tableview

我在底部添加了一个额外的行,上面写着“添加新”

- (void)setEditing:(BOOL)editing animated:(BOOL)animated
{
    [super setEditing:editing animated:animated];

    NSArray *paths = [NSArray arrayWithObject:
                        [NSIndexPath indexPathForRow:1 inSection:0]];
    if (editing)
    {
        [[self tableView] insertRowsAtIndexPaths:paths 
                                withRowAnimation:UITableViewRowAnimationTop];
    }
    else {
        [[self tableView] deleteRowsAtIndexPaths:paths 
                                withRowAnimation:UITableViewRowAnimationTop];
    }
}

当然还有带有动画的 UITableView 变换, 但奇怪的是我刚刚添加的行之前的行,其动画与其他所有不同。

所有行都执行“滑入”动画,但最后一个执行“淡入”动画。

我没有在倒数第二行(或任何其他行)设置任何动画,如果我没有添加新行,当我切换到编辑模式时,动画会正常滑入。

不知何故我找不到答案,我用手机上的联系人应用程序检查,当他们在编辑模式下添加新行时,它没有像我那样奇怪的动画。

任何帮助将不胜感激。 谢谢

【问题讨论】:

    标签: uitableview editing


    【解决方案1】:

    这可能不是您想要的答案,但我也有同样的问题。但是它只出现在 iPhone Simulator 3.1.3 或更早版本上,而不出现在 3.2 iPad Simulator 上。我想假设这个动画故障是 iPhone (SDK) 中的一个错误是可以保存的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2019-05-15
      • 2019-03-22
      • 1970-01-01
      • 1970-01-01
      • 2010-10-16
      相关资源
      最近更新 更多