【发布时间】:2012-02-01 08:47:17
【问题描述】:
我创建了一个自定义 UITableViewCell(我创建了一个扩展 UITableViewCell 的类)并创建了一个包含我的自定义单元格的 xib 文件。一切都很好,但我有以下问题。我创建了带有 4 个标签的自定义单元格,并将标签连接到 Xcode 4 中的代码。当调用创建表的函数时,我无法访问标签。这里是代码。
`
// Customize the appearance of table view cells.
public override UITableViewCell GetCell (UITableView tableView,MonoTouch.Foundation.NSIndexPath indexPath)
{
string cellIdentifier = "Cell";
var cell = tableView.DequeueReusableCell (cellIdentifier);
//cell = null;
if (cell == null) {
cell = new MyCustomCell();
var views = NSBundle.MainBundle.LoadNib("MYCustomCell", cell, null);
cell = Runtime.GetNSObject( views.ValueAt(0) ) as MyCustomCell;
}
return cell;
}
有什么建议吗?
【问题讨论】:
标签: iphone uitableview xamarin.ios