Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionViewLayout with Horizontal Scroll and Pagination enabled

enter image description hereenter image description here
I need to prepare a layout like IOS spring board i.e Grids with horizontal scrolling, pagination enabled and most importantly Cells should be arranged row wise not column wise(in 2nd image).I tried to do this using UICollectionViewFlowLayout but it arranges the cells column wise(like first image).

Later i come to know, this can be achieved with UICollectionViewLayout but i'm bit confused with the Apple Documentation on few points:
1.How to get horizontal Scrolling using UICollectionViewLayout.
2.Can we enable pagination.
3.Is it using Rows & columns concepts.

like image 310
Arun_ Avatar asked Nov 02 '22 15:11

Arun_


1 Answers

  1. UiCollectionviewLayout doesn't have any default scrolling property.If we set the ContentSize more in Width it will automatically enable Horizontal Scrolling ,same for vertical scrolling and if fill in both width and height it will enable both horizontal and vertical scrolling.

  2. Pagination can enabled by using :

    collectionviewlayout.collectionview.pagingEnabled = YES;
    
  3. It don't have any Rows & Column concept,it all depends upon the user customisation.
    Apple Documentation For UICollectionViewLayout

    Damir.me

like image 155
Arun_ Avatar answered Nov 10 '22 04:11

Arun_