我正在尝试在F#中实现以下内容:
public class SimpleCollectionViewController : UICollectionViewController
{
static NSString animalCellId = new NSString ("AnimalCell");
public override void ViewDidLoad ()
{
base.ViewDidLoad ();
CollectionView.RegisterClassForCell (typeof(AnimalCell), animalCellId);
}
但是我不知道如何访问行中的基础CollectionView
:
CollectionView.RegisterClassForCell (typeof(AnimalCell), animalCellId);
这是我的F#代码:
[<Register ("LandlordHome")>]
type LandlordHome (handle:IntPtr) as x =
inherit UICollectionViewController (handle)
let NSString animalCellId = new NSString("AnimalCell")
override x.ViewDidLoad () =
base.ViewDidLoad ()
CollectionView.RegisterClassForCell(typeof(AnimalCell), animalCellId)
然而,这会引发错误The value, namespace, type or module 'CollectionView' is not defined. Maybe you want one of the following: Collections CoreLocation UICollectionView (FS0039)