我遵循this教程爲了創建一個自定義單元格。Monotouch iphone定製UITableView
我創建的界面生成器自定義單元格,看起來像:
在我的ViewController我添加了一個UITableView並將其綁定到數據:
myTable.Source = new ListSource();
的GetCell方法列表來源:
public override UITableViewCell GetCell (UITableView tableView, MonoTouch.Foundation.NSIndexPath indexPath)
{
// Reuse a cell if one exists
CustomListCell cell = tableView.DequeueReusableCell ("QCell") as CustomQuestionsListCell;
if (cell == null)
{
// We have to allocate a cell
var views = NSBundle.MainBundle.LoadNib ("CustomListCell", tableView, null);
cell = Runtime.GetNSObject (views.ValueAt (0)) as CustomListCell;
}
return cell;
}
問題是,顯示在最後看起來像這樣:
這似乎有某種重疊。任何想法爲什麼會發生?
謝謝!
謝謝!它解決了我的問題:) –