Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Aligns collection view cells to the center of the screen.

License

Notifications You must be signed in to change notification settings

argon/ANDistributedFlowLayout

 
 

Repository files navigation

ANDistributedFlowLayout

ANDistributedFlowLayout is a subclass of UICollectionViewFlowLayout which distributes cells evenly in across each row.

Usage

# In your Podfile

pod 'ANDistributedFlowLayout'

Objective-C:

ANDistributedFlowLayout *layout = [ANDistributedFlowLayout new];
layout.minimumInteritemSpacing = 10.f;
layout.minimumLineSpacing = 10.f;

[[UICollectionViewController alloc] initWithCollectionViewLayout:layout];

Swift:

let layout = ANDistributedFlowLayout()
layout.minimumInteritemSpacing = 10.0
layout.minimumLineSpacing = 10.0

UICollectionViewController(collectionViewLayout: layout)

Example

See the layout in use in the ./Example app:

About

Aligns collection view cells to the center of the screen.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 92.4%
  • Ruby 7.6%