网站/小程序/APP个性化定制开发,二开,改版等服务,加扣:8582-36016

Airbnb-inspired 的视图布局效果

应用介绍

    作者ninjaprox,源码NVBnbCollectionView,仿 Airbnb-inspired 的视图布局效果。横屏和竖屏展示的效果不同 安装: 1、cocoapods 安装cocoapods:$ gem install cocoapods 在 podfile 中添加以下一行 pod “NVBnbCollectionView” 然后执行 $ pod install 2、手动安装 将 NVBnbCollectionView 手动拽入文件夹。、 使用说明: 就像使用 UICollectionView 一样,即可使用 NVBnbCollectionView。 1、Storyboard 将 collectionView的 Class 替换为:NVBnbCollectionView Layout 替换为:NVBnbCollectionViewLayout 所有属性都可以进行可视化的更改。 IBInspectable 需要的环境是 Xcode 6 + 2、纯代码 NVBnbCollectionViewLayout *layout = [[NVBnbCollectionViewLayout alloc] init]; NVBnbCollectionView *collectionView = [[NVBnbCollectionView alloc] initWithFrame:CGRectMake(0, 0, 500, 500) collectionViewLayout:layout]; layout.gridCellSize = CGSizeMake(150, 150); layout.parallaxCellSize = CGSizeMake(300, 300); // Set other properties of layout if need be Data source 三个可选实现的 DataSource 方法 - (NSInteger)numberOfItemsInBnbCollectionView:(NVBnbCollectionView *)collectionView; - (UICollectionViewCell *)bnbCollectionView:(NVBnbCollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath; - (NVBnbCollectionViewParallaxCell *)bnbCollectionView:(NVBnbCollectionView *)collectionView parallaxCellForItemAtIndexPath:(NSIndexPath *)indexPath; 代理方法 Delegate: - (void)loadMoreInBnbCollectionView:(NVBnbCollectionView *)collectionView; 创建有视差效果的 Cell: NVBnbCollectionViewParallaxCell *parallaxCell = [collectionView dequeueReusableCellWithReuseIdentifier: forIndexPath:indexPath]; cell.parallaxImage = [UIImage imageNamed:];

    立即下载

    请到会员中心签到后即可获得免费下载!

    相关下载

    评论 共有 0 条评论

    暂无评论
    0
    0
    0
    立即
    投稿
    发表
    评论
    返回
    顶部