Latest 0.1.2
Homepage https://github.com/coder-zjq/JQCollectionViewWaterfallLayout
License MIT
Platforms ios 6.0
Authors

Version
License
Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Direction Image
UICollectionViewScrollDirectionVertical JQCollectionViewWaterfallLayout
UICollectionViewScrollDirectionHorizontal JQCollectionViewWaterfallLayout

Feature

  • [x] vertical and horizontal scroll direction;
  • [x] different row/col count with different section;
  • [x] section headerView and footerView;
  • [x] contentInset of collectionView;
  • [x] inset for section;
  • [x] updates of UICollectionView cells;
  • [x] same usage as UICollectionViewFlowLayout.

Requirements

iOS 6.0+

Installation

JQCollectionViewWaterfallLayout is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod 'JQCollectionViewWaterfallLayout'

Usage

Same usage as UICollectionViewFlowLayout. But you should pay attention to the UICollectionViewDelegateFlowLayout protocol method collectionView:layout:sizeForItemAtIndexPath:.


- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {

    // When scroll direction is UICollectionViewScrollDirectionVertical, the item width is fixed, the item height is flexible. And you can change the col count by measure the item width.

    // When scroll direction is UICollectionViewScrollDirectionHorizontal, the item height is fixed, the item width is flexible. And you can change the row count by measure the item height.

}

(see more detail in Example Project)

Author

coder-zjq, [email protected]

License

JQCollectionViewWaterfallLayout is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "JQCollectionViewWaterfallLayout",
    "version": "0.1.2",
    "summary": "UICollectionView waterfall layout.",
    "description": "UICollectionView waterfall layout:n1. support vertical and horizontal scroll direction;n2. support different row/col count with different section;n3. support section headerView and footerView;n4. support UICollectionView updates.",
    "homepage": "https://github.com/coder-zjq/JQCollectionViewWaterfallLayout",
    "screenshots": "https://github.com/Coder-ZJQ/JQCollectionViewWaterfallLayout/blob/master/Image/demo_vertical.gif?raw=true",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "coder-zjq": "[email protected]"
    },
    "source": {
        "git": "https://github.com/coder-zjq/JQCollectionViewWaterfallLayout.git",
        "tag": "0.1.2"
    },
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "JQCollectionViewWaterfallLayout/Classes/**/*"
}

Pin It on Pinterest

Share This