【发布时间】:2013-02-17 21:05:11
【问题描述】:
从我的 CustomClass 访问网点时:UICollectionViewCell,它们显示为未初始化并且无法设置正确的值。
我见过的每个示例都使用普通的类(没有 XIB)来设置 UI。
[Register("CustomCommentCell")]
public partial class CustomCommentCell : UICollectionViewCell
{
public static readonly NSString Identifier = new NSString("CustomCommentCell");
public CustomCommentCell () : base()
{
}
public CustomCommentCell (IntPtr handle) : base (handle)
{
}
public void updateData()
{
this.lblComment.Text = "Test";
}
}
另一方面,我已经注册了这个类: this.tableComments.RegisterClassForCell(typeof(CustomCommentCell),commentCellId);
并正确设置 GetCell。 但是,当尝试将 outlet 设置为特定值时,它表示它为 null。 (this.lblcomment = null) 虽然它应该是一个 UILabel 初始化。
有什么线索吗?
【问题讨论】:
标签: xamarin.ios custom-controls xib uicollectionviewcell