
#import "scoreboardCollectionVIEwController.h"#import "scoreboardCollectionVIEwCell.h"#import "scoreboardReusableVIEw.h"#import "scoreboardModel.h"#import "scoreboard.h"...- (voID)vIEwDIDLoad { [super vIEwDIDLoad]; // Register cell classes UINib *cellNib = [UINib nibWithNibname:@"scoreboardCollectionVIEwCell" bundle:nil]; [self.collectionVIEw registerNib:cellNib forCellWithReuseIDentifIEr:@"cell"]; [self.collectionVIEw registerClass:[scoreboardReusableVIEw class] forSupplementaryVIEwOfKind:UICollectionElementKindSectionheader withReuseIDentifIEr:@"scoreboardheader"]; self.collectionVIEw.backgroundcolor = [UIcolor colorWithPatternImage:[UIImage imagenamed:@"dark_fish_skin_"]]; }...- (CGSize)collectionVIEw:(UICollectionVIEw *)collectionVIEw layout:(UICollectionVIEwLayout*)collectionVIEwLayout referenceSizeforheaderInSection:(NSInteger)section{ return CGSizeMake(self.vIEw.frame.size.wIDth,34);}- (UICollectionReusableVIEw *)collectionVIEw:(UICollectionVIEw *)collectionVIEw vIEwForSupplementaryElementOfKind:(Nsstring *)kind atIndexPath:(NSIndexPath *)indexPath { scoreboardReusableVIEw *vIEw = [[scoreboardReusableVIEw alloc] init]; vIEw = [collectionVIEw dequeueReusableSupplementaryVIEwOfKind:UICollectionElementKindSectionheader withReuseIDentifIEr:@"scoreboardheader" forIndexPath:indexPath]; return vIEw;} 这是我的xib的屏幕截图:
解决方法 好的,我解决了.问题在于我的vIEwDIDLoad方法[self.collectionVIEw registerClass:[scoreboardReusableVIEw class] forSupplementaryVIEwOfKind:UICollectionElementKindSectionheader withReuseIDentifIEr:@"scoreboardheader"];
从我使用笔尖开始,应该是:
[self.collectionVIEw registerNib:[UINib nibWithNibname:@"scoreboardReusableVIEw" bundle:nil] forSupplementaryVIEwOfKind:UICollectionElementKindSectionheader withReuseIDentifIEr:@"scoreboardheader"];@H_502_0@ 总结
以上是内存溢出为你收集整理的ios – UICollectionView Header xib没有显示全部内容,希望文章能够帮你解决ios – UICollectionView Header xib没有显示所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)