现在的位置: 首页 > 综合 > 正文

iOS-UITableView使用reloadSections刷新section问题

2018年02月02日 ⁄ 综合 ⁄ 共 473字 ⁄ 字号 评论关闭

一般使用直接使用

#define Secons  5  行数

 [famousTangTable reloadSections:[[NSIndexSet alloc] initWithIndex:Secons] withRowAnimation:UITableViewRowAnimationAutomatic];

刷新某一行时会使那一行的section消失掉,老外给的解决方法是

 [CATransaction begin];
 [CATransaction setCompletionBlock:^{
      [famousTangTable reloadData];
 }];
 <span style="font-family: Arial, Helvetica, sans-serif;">[famousTangTable reloadSections:[[NSIndexSet alloc] initWithIndex:2] withRowAnimation:UITableViewRowAnimationAutomatic];</span>
 [CATransaction commit];

就可以解决消失问题

抱歉!评论已关闭.