I'm using in one of my apps UICollectionView, with custom cells but with default flow. Currently this view shows 3 cells in a row (all of them the same size). The cells fill the row from left to right, but I need it from right to left.
Is it possible? Do I need to create custom flow layout? If so, anyone can give a simple example?
Any help will be appreciated.
Assuming you are expecting ONLY three cells, and using a header view for this collection view, you will need to perform the following steps:
override UICollectionViewFlowLayout
(GS is for Groboot SmarTech :))
the .m should look like this:
In the Class which you display the CollectionView, you need to do this:
if you are using storyboards: 1. change the collectionView layout to custom (in the attribute inspector) 2. set it's class to GSRightToLeftCollectionViewFlowLayout. 3. in ViewDidLoad (or whenever you perform initialization)
i had the same issue because of an arabic translation.
Here's my solution: Create a subclass of UICollectionViewFlowLayout and overwrite
I used NSLocales character direction as trigger for the RTL translation. If it's an LTR language, it just returns the default attributes.
Hope it's helpful.