iOS-UITableView使用reloadSections刷新section问题

来源:互联网 发布:重庆网络刷票投票公司 编辑:程序博客网 时间:2024/06/06 20:28

一般使用直接使用

#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];

就可以解决消失问题

1 0