解决cell重用
来源:互联网 发布:淘宝网羽绒服半成品 编辑:程序博客网 时间:2024/05/21 05:36
方法一:
//解决侧拉栏重用问题关键 (每次重绘cell时 移除旧的)
// [[cell.contentView subviews] makeObjectsPerformSelector:@selector(removeFromSuperview) withObject:nil];
方法二:
//换成这句防止cell的重用
NSString *cellIdentifier = [NSString stringWithFormat:@"%ld_%ld", (long)indexPath.section, (long)indexPath.row];
方法三:
将控件置空
例如:
cell.typeLabel1.text = nil;
cell.typeLabel1.layer.backgroundColor = nil;
cell.typeLabel1.layer.borderColor = nil;
cell.typeLabel1.layer.borderWidth = 0;
cell.contentLabel1 =nil;
cell.lineView.backgroundColor = nil;
cell.citylabel1.text = nil;
cell.areaLabel1.text = nil;
[cell.commentBtu1 setBackgroundImage:nil forState:UIControlStateNormal];
[cell.likeBtu1 setBackgroundImage:nil forState:UIControlStateNormal];
- 解决cell重用
- 解决cell重用
- 解决UITableView中cell重用机制
- UITableview 多选 解决cell重用问题
- UITableview 多选 解决cell重用问题
- 解决TableView的Cell重用问题
- 解决UITableView中Cell重用机制问题
- ios之清除cell缓存,解决cell的重用问题。
- cell 重用
- cell重用
- iOS 解决cell因重用机制出错的问题
- tableView重用cell原理
- tableView重用cell原理
- tableView重用cell原理
- tableView重用cell原理
- UITableView cell的重用
- cell重用机制理解
- tableView重用cell原理
- selenium2 在win7和IE下的一些错误
- TrueCrypt简介、在VS2008下的编译过程
- Mac OS X 上Lua的安装方法
- Android NDK开发(六)——使用开源LAME转码mp3
- Windows下配置tomcat7 https
- 解决cell重用
- 触摸事件处理
- ios学习计划
- 使用二进制数枚举子集
- Static Blocks in Java
- 10种常用的网络营销方法
- SQL性能优化(转)
- 写代码如坐禅:你是哪一类程序员
- C#判断字符串是否是满足指定位数的小数或整数