So basically my problem is that my uicollectionview's cells are ordered from top to bottom, rather than from left to right.
This is what it looks like -
[1][4][7]
[2][5][8]
[3][6][9]
This is what i want -
[1][2][3]
[4][5][6]
[7][8][9]
Another problem is when i scroll horizontally instead of moving the page a full 320points. It only moves enough to fit the next cell in the view.
this is what it looks like -
[2][3][10]
[5][6][ ]
[8][9][ ]
this is what i want -
[10][ ][ ]
[ ][ ][ ]
[ ][ ][ ]
I was hoping rendering it horizontally would fix it though. I'm still new to ios so please show me how to do it, all the tuts i searched are not for my exact problem or is outdated.
1) If you are using horizontal scrolling in collection view, the order will be like what you have
If you want this order to change, you have to use vertical scrolling.
2) If you want collection view to scroll a full page, enable paging from IB or
You have to implement a CustomLayout to solve this problem. Here is my solution:
Assuming that you are using a section for each "page", have a look at this picture, which describes how the cells are build:
so instead of [0..11] we want this order: [0,3,6,9,1,4,7,10,2,5,8,11].
If you look further at the second array, you can rebuild this one using the number of columns and number of rows of your pages:
Remember to use sections for this solution!
This is my solution, hope it helpful: