简体   繁体   中英

Vertical CollectionView inside an horizontal CollectionView Swift iOs

I am an Android dev trying to learn iOs development.

I am trying to implement a vertical scrolling UI inside an horizontal paging scroller (Like a RecyclerView inside a ViewPager).

I know I should use nested UICollectionView, I saw this tutorial doing similar stuff, however, it uses UITableView to create the reversed layout style (Horizontal scroll inside vertical scroll).

Can you tell me the best practice to implement this kind of layout? Is there any tutorial out there? I wasn't able to find really much (most stuff was regarding the reversed layout)

Thanks

edited: 1: if you want couple main pages you should implement uipageviewcontroller, to be able paging horizontally

2: if you want a lot reusable cells paging horizontally you should implement UICollectionViewController

if you need vertical scroll functionality inside every page/cells depends if you want paging/scrolling with many cells (you should use collection view) or scrolling some content like text or so (you want to use scrollview). And then you need to put UICollectionView/UIScrollView as a subview on your pages(uipageviewcontroller) / cells(collectionView)

btw. adding vertical scrolling if you need collectionviewcontroller would be bad idea, because you'd have many scrollviews within many cells

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM