草庐IT

MyCollectionViewCellForCollection

全部标签

ios - 以编程方式创建 uicollectionview 时使用自定义 init 方法

由于Storyboard的限制,我正在以编程方式创建UICollectionView。这一切正常,当我想添加一个UICollectionViewCell时,我执行以下操作:[collectionViewregisterClass:[Cellclass]forCellWithReuseIdentifier:@"ID"];我想知道的是如何使用“Cell”类中的自定义初始化方法,因为我无法执行以下操作:[collectionViewregisterClass:[[Cellclass]init_custom]forCellWithReuseIdentifier:@"ID"];问题:如何使用自定