ios UITableview 刷新某一个cell 或 section

ios UITableview 刷新某一个cell 或 section

   

//一个section刷新

NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2];

[tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic];

//一个cell刷新

NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0];

[tableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:indexPath,nil] withRowAnimation:UITableViewRowAnimationNone];

时间: 2024-08-10 17:19:33

ios UITableview 刷新某一个cell 或 section的相关文章

IOS UITableView reload 刷新某一个cell 或 section

通常刷新整个列表 我们都使用[self.tableView reloadData]; 有的时候,有变化更新的只是某一行 row 或者是某个section 所以只更新这一行就好了 //一个section刷新 int section_index=10;//更新第11个sectioin [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:section_index] withRowAnimation:UITableViewRowAn

ios UITableView 获取点击cell对象

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell= [tableView cellForRowAtIndexPath:indexPath]; // 获取cell 对象 UILabel *name = (UILabel *)[cell.contentView viewWithTag:111]; // 获取昵称 _inp

[IOS 开发]TableView如何刷新指定的cell 或section

//一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0]; [tableView r

tableView刷新指定的cell 或section和滚动到指定的位置

转自:http://blog.csdn.net/tianyou_code/article/details/54426494 //一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NSIndexPath *index

TableView刷新指定的cell 或section

1 //一个section刷新 2 3 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; 4 5 [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; 6 7 8 9 //一个cell刷新 10 11 NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 in

iOS UITableView通过代码自定义Cell(Cell高度不一定)

1.新建一个继承自UITableView的类 2.重写initWithStyle:reuseIdentifier:方法 添加所有需要显示的子控件(不需要设置子控件的数据 和 frame,并且子控件要添加到self.contentView中). 进行子控件的一次性的属性设置(有些属性只要设置一次,比如字体 和 某些固定的图片) 3.提供两个模型 数据模型:存放 文字数据 和 图片数据 frame模型:存放数据模型,所有子控件的frame,cell的高度 4.cell拥有一个frame模型 (不要直

uitableview 刷新一行

ios UITableview 刷新某一行 或 section //一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NSIndexPath *indexPath=[NSIndexPath indexPathFor

UITableView刷新单个cell或者单个Section

//一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0]; [tableView r

tableView指定刷新一个cell或一个section

//一个section刷新 NSIndexSet *indexSet=[[NSIndexSet alloc]initWithIndex:2]; [tableview reloadSections:indexSet withRowAnimation:UITableViewRowAnimationAutomatic]; //一个cell刷新 NSIndexPath *indexPath=[NSIndexPath indexPathForRow:3 inSection:0]; [tableView r