RouletteWheelCollectionViewLayout 0.0.1

RouletteWheelCollectionViewLayout 0.0.1

测试已测试
语言语言 Obj-CObjective C
许可证 MIT
发布上次发布2014 年 12 月

Kenny Tang 维护。



  • Kenny Tang

RouletteWheelCollectionViewDemo

这是 Yahoo TimeTraveler 应用风格的卡片轮的哥伦比亚展览会布局子类的实现示例。

详情请参阅:http://corgitoergosum.net/?p=1296

许可证

MIT (https://github.com/kenshin03/RouletteWheelCollectionViewDemo/blob/master/LICENSE)

截图

Screenshot

Vimeo 视频

使用方法

  • 在您的类中导入 RVCollectionViewCell.hRVCollectionViewLayout.h
  • 创建一个 UICollectionView 实例,并使用 RVCollectionViewLayout.h 作为布局类。
  • 实现必要的 UICollectionViewDataSourceUICollectionViewDelegateFlowLayout 方法。
  • 准备您自己的数据源。

示例代码

demoViewController.m

#import "RVCollectionViewCell.h"
#import "RVCollectionViewLayout.h"

@interface RVViewController ()<UICollectionViewDataSource, UICollectionViewDelegateFlowLayout>
...

/* inits the layout object and sets it to your uicollectionview via setCollectionViewLayout: */

    [self.collectionView registerClass:[RVCollectionViewCell class] forCellWithReuseIdentifier:@"ItemIdentifier"];

    self.collectionViewLayout = [[RVCollectionViewLayout alloc] init];
    self.collectionViewLayout.superView = self.view;
    [self.collectionView setCollectionViewLayout:self.collectionViewLayout];

...

/* In cellForItemAtIndexPath:, return an instance of RVCollectionViewCell */

-(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
    RVCollectionViewCell *cell = (RVCollectionViewCell *)[collectionView dequeueReusableCellWithReuseIdentifier:@"ItemIdentifier" forIndexPath:indexPath];
    cell.imageView = self.imagesArray[indexPath.item];
    return cell;
}

致谢

卡片图像是 DeviantArts 上的 yozzo 的作品 - http://yozzo.deviantart.com/