0

I have a collection view of 2 columns and 3 rows. I have a button by which I change the language of my whole app from english to arabic. I wanted to flip my collection view as well .

I have successfully flipped the view (means my columns are swapped ) but they its cell also got reversed . Can anyone tell me how I can reverse back my cells of collection view ?

My code for flipping collection view :

[self.dashBoardCollectionView setTransform:CGAffineTransformMakeScale(-1, 1)];
soumya
  • 3,801
  • 9
  • 35
  • 69
warzone_fz
  • 472
  • 1
  • 9
  • 24
  • 1
    try in your `cellForItemAtIndexPath`, going `[cell.contentView setTransform:CGAffineTransformMakeScale(-1, 1)];` if the whole collectionview is being flipped as well – Fonix Jul 14 '15 at 07:12
  • What platform are you working on? iOS 8 or iOS 9? Also, are you using UICollectionViewFlowLayout? – wakachamo Jul 14 '15 at 08:44

1 Answers1

-1

Yes it is possible to without transformation of collection view you can flip the view and based on that all subview of that view will flip and you can give a support for RTL. For that you must need to give trilling and leading constraints horizontally.

semanticContentAttribute This property will work for the flip view programmatic and storyboard. You can use forceLeftToRight and forceRightToLeft according your requirement.

  • This advice doesn't work. It has known drawbacks http://stackoverflow.com/questions/33130331/uicollectionview-ios-9-issue-on-project-with-rtl-languages-support – Sander Jan 25 '17 at 13:14
  • thank you for your solution , it's working with me in cell with arabic mode – Abdulrahman Masoud Jun 16 '19 at 15:53