【发布时间】:2017-05-17 12:38:48
【问题描述】:
我有一个tableView,包含三个部分。最初存在单元格内容重复的问题。
通过将单元格的重用标识符设置为nil 来解决。之后,在第 3 部分的第一个单元格的位置出现黑条/颜色,就像在this 屏幕截图上一样。
This 是我以前的问题。并将单元实现更改为,
static NSString *cellIdentifier=[NSString stringWithFormat:@"Cell%ld%ld",(long)indexPath.section,(long)indexPath.row];
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:cellIdentifier];;
if(cell==nil){
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
有人知道是什么原因吗?任何帮助表示赞赏。
【问题讨论】:
-
添加一些代码和截图
-
不要将重用标识符设置为
nil。这真是糟糕的代码。为您最初的问题找到另一个解决方案或在此处提出相关问题。 -
请告诉我们你
tableView的实现! -
@DarjiJigar 请检查随附的屏幕截图。
-
@RagheeM 不在 cmets 中发布代码。请编辑您的原始问题。
标签: ios objective-c uitableview