这里UICollectionReusableView即是UICollectionView的Header,可以跟随整体一起滑动的。这个效果类似UITableView的header。
1.我是以xib的形式创建的
2.接下来就是主要的代码了
#import "ViewController.h"
#import "MyCell.h"
#import "SuppleView.h"
#define Width [UIScreen mainScreen].bounds.size.width
#define Height [UIScreen mainScreen].bounds.size.height
@interface ViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout>
@property (retain) UICollectionView* collectionView;
@end
@implementation ViewController
- (void)view

本文介绍了如何使用Xib创建并利用UICollectionView配合UICollectionReusableView来实现类似UITableView Header的滑动效果,通过创建继承UICollectionReusableView的类并在代码中进行设置。
最低0.47元/天 解锁文章
1万+

被折叠的 条评论
为什么被折叠?



