Question

I have three different kind of objects that I want to display in collection view. But if in section 0 is only 1 element, next section starts from new column.

enter image description here

Can I tell to the layout that it should show items in different sections one after the other with no breaks?

Was it helpful?

Solution 2

My solution is to use 1 section and create methods for determinate abstract sections. In addition, I add -infoItemsCount, -visibleItemsCount and -hiddenItemsCount and same methods for generating cells and other.

OTHER TIPS

Sure, but if that never changes, why not make two side-by-side sub views? The left one contains the one element, the right one contains the collection view you originally planned to use.

That way the layout doesn't need to know how to work around the left element.

Additionally, you can use one data source. Make datasource[0] the left one, And use datasource[indexPath.row +1] for the whole cellForRow..... method.

Just remember to set total cells in the collection view to [datasource count] -1

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top