Questions tagged [uicollectionviewcompositionallayout]
117 questions
17
votes
4 answers
UICollectionViewCompositionalLayout bug on iOS 14.3
I'm experiencing a weird layout issue on iOS 14.3 with collection views using a UICollectionViewCompositionalLayout combined in my case with the UICollectionViewDiffableDataSource.
The issue is about the wrong position of the inner…
![](../../users/profiles/2975743.webp)
drakon
- 477
- 3
- 15
6
votes
1 answer
How to create a grid layout with equal row heights using UICollectionViewCompositionalLayout
I've successfully been able to create a grid layout using UICollectionViewCompositionalLayout. However, I am unable to find a clever way of ensuring the UICollectionViewCell in each row in the grid are of the same height when their heights are…
![](../../users/profiles/3896650.webp)
John Slade
- 168
- 6
5
votes
1 answer
UICollectionView for non-grid or semi-grid layout
I am trying to implement a multi-row sequence of items (like Video editing sequence in Final Cut Pro or Adobe Premiere pro shown below).
While I one can always implement it using UIScrollView and placing custom views manually, it would be tedious…
![](../../users/profiles/917521.webp)
Deepak Sharma
- 4,106
- 3
- 37
- 84
5
votes
1 answer
Compositional Layout IOS 13 Group background color
I was trying to find if there is an approach we can use to give background color to a group while using compositional layout. I tried to find a direct API that i can use but didn't find anything.
![](../../users/profiles/2489880.webp)
suraj
- 294
- 2
- 14
4
votes
1 answer
Can make this layout with a UICollectionViewCompositionalLayout
I am trying to create a 'tag cloud' section using a UICollectionViewCompositionalLayout
I would like a full width section of items followed by a section that wraps in this fashion
Essential HR, Financial Wellbeing and Employee engagement would each…
![](../../users/profiles/7579156.webp)
Harry Blue
- 3,068
- 5
- 24
- 58
4
votes
1 answer
Collection View Diffable Data Source cells disappearing and not resizing properly?
I'm having a really weird issue with my collection view. I'm using the Compositional Layout and Diffable Data Source APIs for iOS 13+, but I'm getting some really weird behavior. As seen in the video below, when I update the data source, the first…
![](../../users/profiles/12581393.webp)
bryan-vh
- 95
- 8
4
votes
0 answers
UICollectionViewCompositionalLayout's sticky header is jerky
I am trying to use the latest UICollectionViewCompositionalLayout to display paginated data using the UICollectionViewDiffableDataSource . I wanted to show a sticky header above the section that would stay on the top always even while loading the…
![](../../users/profiles/9421473.webp)
Prasad
- 116
- 5
4
votes
0 answers
UICollectionView Compositional Layout header with pinToVisibleBounds is strangely obscured by cells
I am using UICollectionView Compositional Layout and want to have a header that is sticking to the top
this should be possible with
header.pinToVisibleBounds = true
however, during scrolling, the header gets strangely obscured, looking like a…
![](../../users/profiles/533422.webp)
Peter Lapisu
- 18,394
- 14
- 107
- 163
3
votes
2 answers
collectionview global header does not push cells down and stays on top instead
I have a collection view header (blue) and cells (red). I want to be able to show/hide header programmatically, however when I show the header programatically it appears on top of the cell (or makes scrollview go down a bit). I would like the header…
![](../../users/profiles/11022906.webp)
Markon
- 273
- 2
- 11
3
votes
0 answers
Dynamic-Sized Header in a CollectionView with Compositional Layout
I have a collection view powered by compositional layout + diffable data source. It uses three supplementary boundary items: a header, footer, and "leading-header".
App Layout Example
The problem is: fractional size for leading headers is based on…
![](../../users/profiles/13551385.webp)
theogood
- 53
- 1
- 1
- 5
3
votes
1 answer
UICollectionViewCompositionalLayout incorrect item size
I'm currently facing an issue with compositional layout which can also be seen in Apple's example -> ConferenceNewsFeedViewController. The item height is set to .estimated(100) and the width is set to .fractionalWidth(1.0). On the initial display…
![](../../users/profiles/1958912.webp)
Carsten
- 93
- 4
3
votes
0 answers
UICollectionViewCompositionalLayout orthogonal section willDisplayCell analytics
I'm using Collection View Compositional Layout and need to have accurate analytics for "userViewedCell" events for orthogonally scrolling sections. I had been using collectionView(willDisplay:forItemAt) to detect when a cell is about to be shown,…
![](../../users/profiles/13731180.webp)
gracie
- 31
- 2
3
votes
0 answers
UICollectionViewCompositionalLayout + UICollectionViewDiffableDataSource: is there a way to change a decoration view depending on section data?
I have a UICollectionView that uses UICollectionViewCompositionalLayout and UICollectionViewDiffableDataSource and it works fine.
Cells are provided by a cellProvider defined in the initialiser of the datasource. The provider returns cells with…
![](../../users/profiles/4566480.webp)
Gerd Castan
- 5,141
- 3
- 35
- 70
3
votes
0 answers
UICollectionViewCompositionalLayout is it possible to create a PinterestLayout?
Can i use UICollectionViewCompositionalLayout to create a Pinterest / Waterflow like layout?
the closes was with
func buildLayout() -> UICollectionViewCompositionalLayout {
// cells
let itemSize = NSCollectionLayoutSize(widthDimension:…
![](../../users/profiles/533422.webp)
Peter Lapisu
- 18,394
- 14
- 107
- 163
3
votes
1 answer
How to deal with inconsistent behavior when change snapshot animatedDifferences value?
I'll start with explanation how things suppose to work:
I have collection view with compositional layout and diffable data source.
Cells are representing tasks, which user can click on and set as done for today,
cells have different appearance…
![](../../users/profiles/12992472.webp)
dakota
- 243
- 3
- 10