首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

UITableView刷新单行数据的步骤

2013-01-04 
UITableView刷新单行数据的方法我们都知道[tableView reloadData]可以将整个tableview的数据刷新,但有些

UITableView刷新单行数据的方法

我们都知道[tableView reloadData];可以将整个tableview的数据刷新,但有些时候我们可能只更改了某一行或多行的数据,不想全部重新来过,怎么办呢?

这就要用到下面这个方法了。

- (void)reloadRowsAtIndexPaths:(NSArray *)indexPaths withRowAnimation:(UITableViewRowAnimation)animation NS_AVAILABLE_IOS(3_0);

示例代码如下:

NSIndexPath  *indexPath_1=[NSIndexPath indexPathForRow:1 inSection:0];

NSArray      *indexArray=[NSArray  arrayWithObject:indexPath_1];

[regTableView  reloadRowsAtIndexPaths:indexArray withRowAnimation:UITableViewRowAnimationAutomatic];


详细请点击本人博客

热点排行