【发布时间】:2015-07-14 22:01:42
【问题描述】:
我有一个带有一个可重复使用单元格的 UITableview。可重复使用的单元格包含一张照片和一个标签。现在我的表格视图中有 7 个项目。加载后,一切都很好。但是当我向下滚动,然后再向上滚动时,细胞已经相互渗入。
这是我在 cellforRowatIndexPath 下的代码:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("PostCell") as! PostTableCellView
cell.imageView!.image = posts[indexPath.row].image.value
let post = posts[indexPath.row]
post.downloadImage()
post.fetchLikes()
cell.post = post
cell.clipsToBounds = true
cell.viewforphoto.clipsToBounds = true
return cell
}
知道会发生什么吗?我现在已经重建了故事板,问题仍然存在。我还将图像视图和表格视图单元格的视图模式更改为宽高比、宽高比填充和比例填充。查看其他类似问题让我知道设置 clipstoBounds = true 是否有帮助,但没有。
【问题讨论】:
标签: ios xcode swift uitableview