Questions tagged [uicollectionviewcompositionallayout]
206 questions
0
votes
1 answer
Stretchy Header in UICollectionViewCompositionalLayout in ios 14?
How can I override layoutAttributesForElements in UICollectionViewCompositionalLayout ?
func createCompositionalLayout() -> UICollectionViewLayout {
let layout = UICollectionViewCompositionalLayout { sectionIndex, layoutEnvironment in
…

rupesh45
- 125
- 2
- 8
0
votes
0 answers
Overriding layoutAttributesForElements(in:) in a UICollectionViewCompositionalLayout subclass
I am looking to subclass UICollectionViewCompositionalLayout with the objective of overriding layoutAttributesForElement(in:) to get the initial layout attributes using super.layoutAttributesForElement(in: rect) and modifying the attributes if some…

Hunter Meyer
- 314
- 1
- 10
0
votes
3 answers
How to equally space cells with a fixed size inside a UICollectionView using compositional layout?
I have a collection view created with compositional layout. Each item has a fixed width and height, and the section occupies the full width of the table (which itself occupies the full width of the screen). I'm trying to create an algorithm to…

Marcos Tanaka
- 3,112
- 3
- 25
- 41
0
votes
1 answer
UICollectionViewCompositionalLayout setting section.orthogonalScrollingBehavior page programmatically?
I am implementing a UICollectionViewCompositionalLayout and using
section.orthogonalScrollingBehavior = .groupPagingCentered
to scroll a section horizontally.
This lets a user scroll from page to page in a section horizontally.
I use…

Gerd Castan
- 6,275
- 3
- 44
- 89
0
votes
0 answers
Replicate iMessage Stickers app using UICollectionViewCompositionalLayout
I'm trying to replicate the Stickers app inside iMessage using the new UICollectionViewCompositionalLayout.
However, I can't seem to be able to reproduce the horizontal "paging" behavior.
There should be n + 1 sections, where n i the number of…

guidev
- 2,695
- 2
- 23
- 44
0
votes
0 answers
Self-sizing cells with UICollectionViewCompositionalLayout
I have a view controller that displays a collection view with self-sizing cells. The collection view has one section that scrolls horizontally. It looks like this:
Problem
The collection view behaves unexpectedly when the view controller is…

JWK
- 3,345
- 2
- 19
- 27
0
votes
1 answer
Horizontal UICollectionViewCompositionalLayout displaying section headers over item cells
I am attempting to use UICollectionViewCompositionalLayout to create this design:
The intention here is for the collection view to scroll horizontally, with the items also scrolling vertically when they overflow using NSCollectionLayoutSection's…

adamjansch
- 1,170
- 11
- 22
0
votes
1 answer
UICompositionalLayout not working as intended (vertical table scroll + horizontal paging)
I've been digging through the "new" compositional layout api introduced in iOS 13, hoping to find a solution to the contrived approach of embedding a UITableView inside a UICollectionViewCell.
I have used this headache-inducing solution in the past…

Renato Silva
- 51
- 10
-1
votes
1 answer
How to replace section having one type of layout with another section contains same items but different layout?
I have created a demo project here to show my problem. Im using a UiCollectionView with UICollectionViewCompositionalLayout and DiffiableDatasource. I have total of 4 sections which are simple named Section1, Section2&, Section3 and Section4. When…

Mel
- 429
- 1
- 4
- 12
-1
votes
1 answer
Collection View Compositional Layouts - Layout on the fly
After seeing the wonderful Advances in Collection View Layout Session, I wondered if is possible to use the capabilities implemented in the new Collection View Compositional Layouts framework to create a layout based on previously unknown cell…

Jorge Frias
- 1,077
- 11
- 13
-2
votes
1 answer
Swift - How change the BackgroundColor of Group in CompositionalLaylout
I'm currently working on a messaging app and using the compositional layout to create the "New Chat" function of Element/What's App. My problem is, that I want to change the Backgroundcolor of my groups like in What's App. I already managed to…

Patrick Kuro
- 3
- 2