我遵循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;
}
问题是,显示在最后看起来像这样:
这似乎有某种重叠。任何想法为什么会发生?
谢谢!
谢谢!它解决了我的问题:) –