Questions tagged [uicollectionviewcompositionallayout]
206 questions
0
votes
1 answer
How to put together items with different width using UICollectionViewCompositionalLayout?
I am trying to create a horizontal list of images with the same size (red tiles), and the last item should be a "view all" cell with a different width (purple tile):
I've been struggling to implement this using UICollectionViewCompositionalLayout,…

phi
- 10,634
- 6
- 53
- 88
0
votes
1 answer
Problem with creating Compositional Layout (UICollectionView)
I want to build the following layout using UIKit.
Currently I'm using an UICollectionView in combination with a Composotional Layout. The following code produces this result:
Relevant Method:
private static func createCompositionalLayout() ->…

finebel
- 2,227
- 1
- 9
- 20
0
votes
1 answer
UICollectionView: Animate cell while scrolling
I want to animate the top and bottom most cells in a UICollectionView as they enter and leave the screen. I don't just want to animate using scrollview delegates and a one time animation. I want the animations to be progress driven.
Example: Top…

bdodge
- 1
- 1
0
votes
1 answer
How to create controller like instagram profile with UICollectionViewCompositionalLayout?
I have to make this Controller which has the same logic as Instagram profile
Tabs and header
Tabs fixed on top
I am using UICollectionViewCompositionalLayout and the problems with tab logic. I use one collection cell and change dates according to…

Vadym Marchenko
- 29
- 1
- 7
0
votes
0 answers
UICollectionViewCompositionalLayout - how to create multiple horizontal sections?
I want to achieve this layout (I'm talking about that horizontal section):
I know, that I can't have multiple sections horizontally side by side, when my layout is vertical by default. But can I achieve something similar just with groups and items…

LukasM
- 11
- 2
0
votes
1 answer
UICollectionViewDiffableDataSource doesn't animate properly on apply
I have a list of items, they are displayed in decreasing order by amount in a list. I hash them by name, so when I change the amounts, they should reorder smoothly on apply.
When I call the apply(snapshot, animatingDifferences: true) function on…

Bence Pattogato
- 3,752
- 22
- 30
0
votes
1 answer
UICollectionViewCompositionalLayout doesn't scroll to incomplete group
I have simple implementation with UICollectionViewCompositionalLayout. There are two sections, every has single row with horizontal scroll and every item at section has 1/4 width of whole container (now it's full screen).
I would like to have paging…

DisQuad
- 53
- 7
0
votes
1 answer
Add a UIPageControl to a NSCollectionLayoutSection
So, I'm developing an app with a structure like in the image, in which some of the sections scroll horizontally, the orthogonalScrollingBehavior has been sen to paging and the behaviour is working as expected, the only issue is that I'd like to have…

mtet88
- 524
- 6
- 21
0
votes
1 answer
How to use a UICollectionViewController's custom initializer with UICollectionViewCompositionalLayout?
Let's say you wanted to use a custom initializer to instantiate UICollectionViewController.
With UICollectionViewFlowLayout, it's straightforward:
init() {
let layout = UICollectionViewFlowLayout()
super.init(collectionViewLayout:…

Kevvv
- 3,655
- 10
- 44
- 90
0
votes
1 answer
Embed CollectionView inside CollectionViewCell with dynamic height
Both collection views use compositional layout and diffable data source. Each outer collection view cell embeds a collectionView.
The outer collection view has estimated group height, i.e.
let itemSize = NSCollectionLayoutSize(widthDimension:…

zrfrank
- 2,631
- 1
- 12
- 18
0
votes
1 answer
UIButton doesn't work when the searchController is active?
I'm using a UICollectionViewCompositionalLayout with a search controller:
just like this
The Problem:
I can't tap on the UI Button present in the header of Section when the search controller is active. But the GestureRecognizer of the Section just…

Nick Guerra
- 11
- 5
0
votes
1 answer
How do you add a CAGradientLayer to a UIBackgroundConfiguration in the new collection views with compositional layouts?
I'd like to add a gradient to a collection view cell's background in the context of the new collection view with compositional layouts. Here's an example of how a cell's background is configured from Apple's sample code Implementing Modern…

Curiosity
- 544
- 1
- 15
- 29
0
votes
0 answers
iOS 14 UICollectionView: setCollectionViewLayout animation is broken when section layout changes from horizontal to vertical
I am struggling with the following issue: I have an UICollectionView with an UICollectionViewCompositionalLayout and two sections. The first section has set orthogonalScrollingBehavior to .continues and has horizontal scrolling. The second section…

xshake
- 345
- 3
- 12
0
votes
1 answer
UICollectionViewCompositionalLayout: custom grid layout where only one cell has to be bigger than the rest
I'm trying to build a photo grid using UICollectionViewCompositionalLayout where the third picture is shown bigger, all the other pictures should be small.
I've come this far:
The problem is that this layout keeps repeating itself, so now one out…

Kevin Renskers
- 5,156
- 4
- 47
- 95
0
votes
2 answers
UICollectionViewCompositionalLayout update cell height
I have the following setup:
UICollectionView with self sizing cells, where their height is defined by their content
UICollectionViewCompositionalLayout that defines the dimensions of items like this
let cellHeight: CGFloat = 260
let…

lawicko
- 7,246
- 3
- 37
- 49