3

我正在尝试在 -44.0 偏移量(隐藏)处向我的 tableview 顶部添加一行,并且在屏幕上看不到任何动画。为此,我打电话给

[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationNone];

UIEdgeInsets ins = self.tableView.contentInset;
    self.tableView.contentInset = UIEdgeInsetsMake(-44.0, ins.left, ins.bottom, ins.right);

问题在于,由于设置了偏移量,这会使表格视图向上移动,然后由于添加行而动画回落。

我希望我现有的 tableview 看起来像它没有移动,并且只需在顶部(隐藏)添加新行,而没有人看到任何东西。

有人知道我如何在后台将行添加到顶部吗?

谢谢!

4

0 回答 0