Latest 1.0.0
Homepage https://github.com/KittenYang/KYTilePhotoLayout
License MIT
Platforms ios 6.0
Frameworks Foundation, UIKit
Authors

KYTilePhotoLayout

CocoaPods Version
License
Platform

A UICollectionViewLayout with a really interesting image layout algorithm.

一个图片布局算法,实现图片的不规则排列,并且大小不一。具体效果如图:

Algorithm introduce article:

算法介绍文章:

Blog

垂直滚动: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.

Latest podspec

{
    "name": "KYTilePhotoLayout",
    "version": "1.0.0",
    "summary": "A UICollectionViewLayout with a really interesting image layout algorithm.",
    "description": "n                   u4e00u4e2au56feu7247u5e03u5c40u7b97u6cd5uff0cu5b9eu73b0u56feu7247u7684u4e0du89c4u5219u7d27u51d1u6392u5217uff0cbA UICollectionViewLayout with a really interesting image layout algorithm.n                   n",
    "homepage": "https://github.com/KittenYang/KYTilePhotoLayout",
    "license": "MIT",
    "authors": {
        "KittenYang": "[email protected]"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source": {
        "git": "https://github.com/KittenYang/KYTilePhotoLayout.git",
        "tag": "1.0.0"
    },
    "source_files": "KYTilePhotoLayout-Demo/Classes/**/*.{h,m}",
    "frameworks": [
        "Foundation",
        "UIKit"
    ]
}

Pin It on Pinterest

Share This