【发布时间】:2015-05-10 14:25:57
【问题描述】:
我对 UITableView 有一点问题。当我第一次向下滚动时,不会加载屏幕外的单元格。当我向上滚动(使未显示的单元格再次离开屏幕)并再次向下滚动时,它们突然出现。我认为这与dequeueReusableCellWithIdentifier 有关。知道如何解决这个问题吗?
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell", forIndexPath: indexPath) as! CustomCellClass
return cell
【问题讨论】:
-
显示更多代码。您需要在 cellForRowAtIndexPath 中设置您的单元格。不仅“出列”它。
标签: xcode uitableview swift