在UITableViewCell xib 里 添加UIColle

2016-08-26  本文已影响60人  兰章海晏

一:在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 

]


上一篇 下一篇

猜你喜欢

热点阅读