ios8 UITableView scrollToRowAtIndexPath与自动调整大小单元格不准确

时间:2015-02-19 18:21:50

标签: ios uitableview ios8 cell

当我的视图第一次出现时,当我尝试一直滚动到表格视图的底部时,它不会滚动到正确的底部单元格。它接近结束但不完全。

如果稍后再次调用该方法,则会滚动到底部。现在我的解决方案是滚动两次,只有在第二次推迟时才会有效。

我想知道这是否是iOS 8中的错误,或者是否有任何我能够以正确的方式行事。

NSIndexPath* path = [NSIndexPath indexPathForRow:[self.someArray count] - 1 inSection:0];

[self.someList scrollToRowAtIndexPath:path
                     atScrollPosition:UITableViewScrollPositionBottom
                             animated:NO];

//TODO: this is kindof a dirty hack for now, there seems to be a bug in ios8 auto sizing cells and figuring out the proper scroll location

dispatch_after(0, dispatch_get_main_queue(), ^{
    [self.someList scrollToRowAtIndexPath:path
                     atScrollPosition:UITableViewScrollPositionBottom
                             animated:NO];
});

0 个答案:

没有答案
相关问题