iOS - UITableViewCell reload 数据刷新method
2016-03-28 21:07
441 查看
文/Sean_Jiang(简书作者)
原文链接:http://www.jianshu.com/p/658bfccf5036
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
刷新特定行的cell
插入特定行数的cell
删除特定行数的cell
先修改模型数据
再调用数据刷新方法
不要直接修改cell上面子控件的属性
原文链接:http://www.jianshu.com/p/658bfccf5036
著作权归作者所有,转载请联系作者获得授权,并标注“简书作者”。
数据刷新方法
重新刷新屏幕上的所有cell[self.tableView reloadData];
刷新特定行的cell
[self.tableView reloadRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:0 inSection:0], [NSIndexPath indexPathForRow:1 inSection:0] ] withRowAnimation:UITableViewRowAnimationLeft];
插入特定行数的cell
[self.tableView insertRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:0 inSection:0], [NSIndexPath indexPathForRow:1 inSection:0] ] withRowAnimation:UITableViewRowAnimationLeft];
删除特定行数的cell
[self.tableView deleteRowsAtIndexPaths:@[ [NSIndexPath indexPathForRow:0 inSection:0], [NSIndexPath indexPathForRow:1 inSection:0] ] withRowAnimation:UITableViewRowAnimationLeft];
数据刷新的原则
通过修改模型数据,来修改tableView的展示先修改模型数据
再调用数据刷新方法
不要直接修改cell上面子控件的属性
相关文章推荐
- [leetcode] 53. Maximum Subarray
- 《leetCode》:Repeated DNA Sequences
- Atitit.Gui控件and面板----数据库区-mssql 2008 权限 配置 报表查看成员
- UVA 540 —— Team Queue
- java 乱码详解_jsp中pageEncoding、charset=UTF -8"、request.setCharacterEncoding("UTF-8")
- 理解 Android Build 系统
- EasyUI学习笔记
- 梳理caffe代码blocking_queue(十)
- iOS UITableView4
- iOS UITableView3
- iOS设计中 UI设计之沙盒与数据持久化
- Leetcode 111. Minimum Depth of Binary Tree My Submissions QuestionEditorial Solution
- UI控件--ViewPager详解带Tab交互的ViewPager(5)
- iOS UITableView2
- iOS UITableView 1
- ui更新机制杂谈
- poj 2524 并查集 Ubiquitous Religions
- UITableView中Cell重用机制导致内容重复解决方法
- 为多种分辨率设计UI
- UI控件--ViewPager详解使用Fragment实现ViewPager滑动(4)