2

I am currently developing a project which supports Right-to-Left languages, too. So far, with RTL support of Apple, I managed %80 of the project to support RTL. However I am stuck with UICollectionView.

For LTR Languages everything works fine as shown below:

enter image description here enter image description here enter image description here

However, when RTL is activated look below, the collection view is loading successfully but when it is trying to expand or in other words reload again, it acts like LTR again, i guess. I added slow motion gif in order to give you some information about the behaviour.

enter image description here enter image description here enter image description here

Any ideas why is this happening? Please not, I referred to this answer here, however it uses vertical scrolling, not horizontal.

Community
  • 1
  • 1
Onur Şahindur
  • 492
  • 8
  • 18

1 Answers1

0

-Are you sure your constraints in AutoLayout are right? -Instead of setting RTL, First when creating the UICollectionView perform a horizontal flip on it. [collectionView_ setTransform:CGAffineTransformMakeScale(-1, 1)];

Then befor returning a cell in method CellForItemAtIndexPath give the cell a horizontal flip.

[cell setTransform:CGAffineTransformMakeScale(-1, 1)];

Hope it will help.

Faisal
  • 162
  • 1
  • 12