0

Instead of this alignment:

x-x-x

x-x-x

I need this one:

xxx--

xxx--

Is it possible with UICollectionViewController?

János
  • 32,867
  • 38
  • 193
  • 353

1 Answers1

1

Yes, what you need to do is subclass UICollectionViewFlowLayout, so you can adjust the UICollectionViewLayoutAttributes by setting the frame of each item to left-align it.

An example of what you are trying to do can be found on Github:

https://github.com/mokagio/UICollectionViewLeftAlignedLayout

This is assuming that you already provide a custom size for each item in your UICollectionView using sizeForItemAtIndexPath.

HTH

Tim Edwards
  • 261
  • 5
  • 8