所以我做了一些自定义表格视图单元格,他们绘制正确,看起来不错,但是一旦我滚过可见单元格的边缘,他们开始重用,这很好,除了当我向后滚动重用单元格时仍然显示并且不重绘。特别是除了最上面的单元外,所有的单元看起来都是一样的。如何在重用后独特地绘制自定义UITableViewCell顶层单元格?
图片详细介绍了发生:
我怎么有这样的编码时,是当细胞获得制造如果indexPath.row大于0添加“重叠效应”这只是在UITableViewCell的contentView上的自定义绘图下放置的uiview上的渐变。
这是我怎么加在的UITableViewController的的tableView的重叠效应:的cellForRowAtIndexPath:
- (UITableViewCell *)tableView:(UITableView *)aTableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"APostCell";
PostCell *cell = [aTableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
CustomPost *aPost = [self.posts objectAtIndex:indexPath.row];
if (indexPath.row > 0) {
[cell addOverlap];
}
cell.postDateLabel.text = [aPost datePostedAsString];
return cell;
}
我将如何实现这个[细胞removeOverlap]?
你在哪里创建单元格如果单元格== nil? – stosha