我们对表格的操作过程中,对某一行的操作,改变了这一行的数据,如果我们要想及时的显示在表格上,就可以用到
- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
这个函数。
indexPaths是你想重新加载的行数,例如我加载1行这个参数就可以这样设置
[NSArray arrayWithObject:[NSIndexPath indexPathForRow:(int)row inSection:0]]
后面一个参数是动画,你可以参看api里定义的动画。
- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation
这个函数。
indexPaths是你想重新加载的行数,例如我加载1行这个参数就可以这样设置
[NSArray arrayWithObject:[NSIndexPath indexPathForRow:(int)row inSection:0]]
后面一个参数是动画,你可以参看api里定义的动画。
表格数据更新
本文介绍如何使用-(void)reloadRowsAtIndexPaths函数来刷新表格中指定行的数据,包括参数indexPaths和动画的设置。
255

被折叠的 条评论
为什么被折叠?



