大佬教程收集整理的这篇文章主要介绍了iOS UITableView reloadRowsAtIndexPaths,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
任何想法为什么?
[self.messageTableView beginupdates]; [self.messageTableView reloadRowsATindexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:count inSection:0]] withRowAnimation:UITableViewRowAnimationNone]; [self.messageTableView endupdates];
谢谢
如果这是一个问题,您可以将单元格配置逻辑拉到cellForRowATindexPath之外,并直接重新配置单元格,而无需通过reloadRowsATindexPaths.这是一个基本的概述:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowATindexPath:(NSIndexPath *)indexPath { NSString *cellId = ...; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId]; if (!cell) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reusEIDentifier:cellId]; } [self tableView:tableView configureCell:cell aTindexPath:indexPath]; return cell; } - (void)tableView:(UITableView *)tableView configureCell:(UITableViewCell *)cell aTindexPath:(NSIndexPath *)indexPath { //cell configuration logic here }
然后,无论您当前正在调用reloadRowsATindexPaths,您都可以这样做,而不会调用heightForRowATindexPath:
UITableViewCell *cell = [self.messageTableView cellForRowATindexPath:indexPath]; [self tableView:self.messageTableView configureCell:cell aTindexPath:indexPath];
以上是大佬教程为你收集整理的iOS UITableView reloadRowsAtIndexPaths全部内容,希望文章能够帮你解决iOS UITableView reloadRowsAtIndexPaths所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。