6

Is it possible to have a collection view with horizontal paging, as well as vertical scrolling?

I would like to have the effect of pages of collection views, where the content can be scrolled vertically, say 20 items, with 5 visible at a time. I would also like to support pages horizontally which also hold 20 items, 5 visible at a time.

Is a single collection view able to handle this or should it be a scrollview with paging, containing collectionviews? That seems a bit weird and the gestures would interfere.

Currently I am only able to page in one direction, which stops scrolling in the other direction.

some_id
  • 29,466
  • 62
  • 182
  • 304

3 Answers3

1

ok you want to make interface like Netflix app there is a lot of tutorial available to achieve this here is the link

1.https://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell-in-swift/

2.http://www.thorntech.com/2015/08/want-your-swift-app-to-scroll-in-two-directions-like-netflix-heres-how/

the above tutorial helped me. and i had given an answer to similar type question

Swift - how to open another viewcontroller with CollectionViewCell inside UITableViewCell

0

I would consider nesting cells. In your paging UICollectionView Have a cell for each column and then in each cell have another UICollectionView that scrolls vertically only.

Dancreek
  • 9,524
  • 1
  • 31
  • 34
0

I was recently developing a keyboard and wanted to add an emoticon keyboard, which needed the same sort of implementation as you're describing as i wanted the emoticons to be categorised and scrollable both ways. I found that a collection view inside of collection view worked the best for me.

This guy wrote a great article that should get you started ashfurrow uicollectionview in a uitableviewcell

TomTom
  • 899
  • 8
  • 16