mardi 27 mai 2014

UICollectionView with diferent cell sizes


Vote count:

0




I'm looking for a layout or a subclass of flowLayout that uses every single available space instead of cell wrapping and going to the next line, something like this:


enter image description here .


Where the smallest cell is like cell number 4 (more like a unit) and cell 1 is about four times the size of cell number 4. Cell number 2 is the size of two merged cell number 4 and so on. Does anyone know a github example or tutorial/demo that could help me achieve this. I was using http://ift.tt/1ipJSyD but the number of columns must be the same in each line. Also I want to change this layout to a "4 unit" wide in landscape (some cells will have to be reordered in the dataSource, but that's no problem) and change back to a "3 unit" wide on portrait. I want to use this in several different views and the order of the and number of "big" and "small" cell may vary but they are always sorted to fit perfectly in the view like this example. Also it needs to be a collection view because then the user can scroll "infinitely" and this will load more cells (but this time only small cells). So any cell after cell number 11 will be the same size. The sizes of cells will be stored in a nsarray containing cell info like its CGsize, so the only thing this layout has to do is to place the cells in the correct places Any suggestions and/or opinions are appreciated, thanks in advance.



asked 29 secs ago






Aucun commentaire:

Enregistrer un commentaire