Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom layout for different cell sizes in UICollectionView

Tags:

I would like to use the new UICollectionView, but I'm not sure if it is possible to build the following:

enter image description here

As you can see, there are two different cell types. One is portrait, one is landscape. When I use the flow layout, it always creates rows of cells which are as high as the tallest cell. Not this kind of "fluid" layout I need.

Is it possible at all to achieve this kind of layout with a UICollectionView?

Has anyone done something like this before? Are there any samples? I already checked out many tutorials and the Class References ...

Thanks!

like image 431
wolfrevo Avatar asked Mar 16 '13 15:03

wolfrevo


People also ask

How do I create a collection layout in Flowview?

flowLayout = ... But in fact you can set the collection view's collectionViewLayout , and it does just what you want: Assigning a new layout object to this property causes the new layout to be applied ... to the collection view's items.

What is UICollectionView flow layout?

A layout object that organizes items into a grid with optional header and footer views for each section.

What is the difference between Uitableview and UICollectionView?

Tableiw is a simple list, which displays single-dimensional rows of data. It's smooth because of cell reuse and other magic. 2. UICollectionView is the model for displaying multidimensional data .


1 Answers

You can check out https://github.com/bryceredd/RFQuiltLayout . Looks like something you can use for this

like image 120
Iwo Dziechciarow Avatar answered Nov 03 '22 01:11

Iwo Dziechciarow