我有一個UITableView
顯示超過50個自定義設計的單元格。表格顯示確定,但如果我滾動表格,則沒有單元格可以重複使用。相反,我的應用只是不斷加載新單元格,這對我的iPhone 3來說非常緩慢。爲什麼我不能重用任何UITableView單元?
什麼可能導致此問題?下面是從我UITableViewSource.GetCell()
方法
var dequeuedCell=tableView.DequeueReusableCell (identifier);
//try to reuse a previously recycled cell, create a new one if none exists
var cell = (ITimeEntryTableCell)dequeuedCell;
if (cell == null)
{
//load a new cell using the XIB file definition
NSBundle.MainBundle.LoadNib (identifier, tableViewController, null);
cell = tableViewController.DurationCell;
tableViewController.DurationCell = null;
}
由於剪斷代碼,
阿德里安
編輯:請注意,我使用MonoTouch的,沒有目標C ...
如果有人像我一樣困惑:在設計師中,它被稱爲「恢復ID」而不是「標識符」。 – Zerga
@Zerga不,它不是。恢復ID是關於狀態恢復。標識符是使用的正確字段。 – jrturton