我在childViewController
上有一个UICollectionViewController
。我有我的childViewController出现在屏幕上。但是,当我注册一个单元格collectionView?.register(MyCustomCell.self, forCellWithReuseIdentifier: CellId)
并使用numberOfItemsInSection
和cellForItemAt
。问题是细胞不会出现,我检查了代码,所以这是正确的。它可以是childViewController的东西吗?
通常,不希望将任何子视图或viewController添加到UICollectionViewController或UITableViewController,因为您将看到不期望的结果,因为它们都从scrollview继承并使添加的内容可以滚动或分散到任何位置,如果您有更好的创建自定义viewController与collectionView和childViewController