Coder Social home page Coder Social logo

newtri's Introduction

KRLCollectionViewGridLayout

Version License Platform

Build Status

TESTING THE GIT REPOS @@@@@@@@@@@@@@@@@@@@@ #####################

This layout is an alternative to UICollectionViewFlowLayout that positions and sizes items using a defined number of columns and an aspect ratio property which force the size of cells, rather than the cells' size telling the layout how to position them (in the way UICollectionViewFlowLayout behaves). By default, this will always show the same number of items in a row no matter how large or small the collection view is.

You can specify the number of items per line and the desired aspect ratio of all items (which is always width / height, regardless of scroll direction):

layout.numberOfItemsPerLine = 5;
layout.aspectRatio = 16.0/9.0;

You can specify metrics similar to UICollectionViewFlowLayout, like so:

layout.sectionInset = UIEdgeInsetsMake(10,20,30,40);
layout.interitemSpacing = 15;
layout.lineSpacing = 5;
layout.scrollDirection = UICollectionViewScrollDirectionVertical;

As of 0.1.x, this layout supports multiple sections, but no supplementary views and no per-section grid metrics.

Usage

To run the example project, clone the repo, and run pod install from the Example directory first. You can either run unit tests on the library itself, or run the sample project for a visual demonstration.

Requirements

iOS 6.0 or greater, and ARC.

Installation

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

pod "KRLCollectionViewGridLayout"

Author

Kevin Lundberg, [email protected]

Contributions

Pull requests are welcome! Please include unit tests for any bugfixes or new features.

License

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

newtri's People

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.