KittenYang/KYTilePhotoLayout
关于
A UICollectionViewLayout with a really interesting image layout algorithm.
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
A UICollectionViewLayout with a really interesting image layout algorithm.
一个图片布局算法,实现图片的不规则排列,并且大小不一。具体效果如图:
Algorithm introduce article:
算法介绍文章:
##垂直滚动:Vertical Scroll


##水平滚动:Horizontal Scroll


##Installation
pod 'KYTilePhotoLayout', '~> 1.0.0'
##How to use
It's just two files: KYTilePhotoLayout.h && KYTilePhotoLayout.m. And it's the subclass of UICollectionViewLayout.So you can easily use like a normal UICollectionViewLayout. eg:
###*Use code:
KYTilePhotoLayout *tileLayout = [[KYTilePhotoLayout alloc]init];
tileLayout.ColOfPortrait = 2;
tileLayout.ColOfLandscape = 3;
tileLayout.LayoutDirection = Vertical;
self.collectionView.collectionViewLayout = tileLayout;
###*Use Interface Builder:
Set the layout's class to KYTilePhotoLayout .Then you can set the value visibly:


##How to invoke transition between Portrait and Landscape:
In you ViewController:
#pragma mark -- RotateToReLayout
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration{
[super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
KYTilePhotoLayout *layout = (KYTilePhotoLayout *)self.collectionView.collectionViewLayout;
[layout invalidateLayout];
}
##License This project is under MIT License. See LICENSE file for more information.
探索相关项目
加载中…