一:在UITableViewCell xib 里 添加UICollecionView 在注册collectionView是要用UINib 方式加载 :
[self.dreamPlanMainTagCollectionView registerNib:[UINib nibWithNibName:@"YKDreamPlanMainTagCollectionCell" bundle:nil] forCellWithReuseIdentifier:@"YKDreamPlanMainTagCollectionCell"];
二:如果在UIViewController里注册collectionView 可以用另一种注册方式collectionView:
- (void)registerClass:(nullable Class)cellClass forCellWithReuseIdentifier:(NSString *)identifier
三:如果是在UITableViewCell xib里添加UICollecitonView 在xib里 设置collectionView 的 delegate 和datasource 无效 ,需要在代码里从新设置delegate 和 datasource




]
网友评论