自定义的Cell的赋值
来源:互联网 发布:excel 显示重复数据 编辑:程序博客网 时间:2024/06/04 18:23
1. 先来看一下我在建表的时候禁用 cell重用机制(为了避免cell内容重复显示), 结果发现 在后面改变_addBtn的 tittle的时候竟然改不了, 晕。。。。 注意:我用的禁用cell 判断条件是cell != nil
也就是说在刷表的时候会将之前建的_addBtn覆盖。解决办法:看下面:二、方法;
一 . 禁用cell重用机制
cell=[[UITableViewCellalloc]initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:ID];
if (cell !=nil)
{
_linkageDeviceLable=[[UILabelalloc]initWithFrame:CGRectMake(_triggerLable.left,0,80,60)];
_linkageDeviceLable.text=@"联动设备";
_linkageDeviceLable.font=[UIFontboldSystemFontOfSize:18];
// _linkageDeviceLable.enabled=NO;
//_linkageDeviceLable.backgroundColor=[UIColor redColor];
[cell.contentViewaddSubview:_linkageDeviceLable];
_addBtn=[UIButtonbuttonWithType:UIButtonTypeCustom];
_addBtn.frame=CGRectMake(_reSwitch.left,_linkageDeviceLable.top,_reSwitch.width,_linkageDeviceLable.height);
[_addBtnsetTitle:@"添加"forState:UIControlStateNormal];
[_addBtnsetTitleColor:[UIColorblackColor] forState:UIControlStateNormal];
_addBtn.titleLabel.font =[UIFontboldSystemFontOfSize:17];
[_addBtnaddTarget:selfaction:@selector(addDeviceAction)forControlEvents:UIControlEventTouchUpInside];
[cell.contentViewaddSubview:_addBtn];
}
return cell;
}
UITableViewCell *cell=[_tableViewcellForRowAtIndexPath:indexpath];
UILabel *newAliaslable=[cell.contentViewviewWithTag:2016+indexpath.row];
UILabel *newMaclable=[cell.contentViewviewWithTag:6102+indexpath.row];
- 自定义的Cell的赋值
- 自定义Cell的用法
- 自定义Cell的线条
- 自定义cell的frame
- 自定义cell的高度
- 自定义cell的用法
- 自定义cell的流程
- 自定义cell的高度
- UITableView 的 自定义cell
- UITableView的自定义cell
- cell的自定义frame
- 自定义cell的间距
- (demo) : jtable的自定义cell
- Table---自定义cell的背景
- 【iOS】自定义Cell的步骤
- iOS 自定义cell的高度
- 自定义不等高的cell
- 正确使用自定义的Cell
- 从零开始移植QT4.8.5之一--在windows下安装QT
- mysql order by优化
- 二叉排序树的插入,查找,删除
- IOS国际化
- hdu1728 逃离迷宫--BFS
- 自定义的Cell的赋值
- Ionic 2 自定义插件typescript用法
- leetcode_c++:栈:Binary Search Tree Iterator(173)
- 禁用cookie后session是如何设置的
- 扩展欧几里得模板
- Android 接入微信支付
- LeetCode 1. Two Sum
- KNN(六)--LSH算法
- Linux上的SSH无法启动,报告/var/empty/sshd must be owned by root and not group or world-writable