Questions tagged [uicollectionviewcompositionallayout]
206 questions
1
vote
1 answer
UICollectionViewCompositionalLayout: right align cells within a section
I have this layout, where the main picture is a UICollectionView, and the thumbnails are in their own UICollectionView.
The design asks for the thumbnails to be right-aligned, so the content in the UICollectionView needs to be pushed to the right.…

Kevin Renskers
- 5,156
- 4
- 47
- 95
1
vote
1 answer
UICollectionView autoscroll on UICollectionViewCompositionalLayout
When using UICollectionViewCompositionalLayout with horizontal and vertical scrolling,
how do i get the corresponding UISCrollView from UICollectionView
to automatically scroll a given section (setContentOffset) by timer
eg. so only ONE section is…

Peter Lapisu
- 19,915
- 16
- 123
- 179
1
vote
2 answers
UICollectionViewCompositionalLayout header misalignment
I have created a custom layout based on UICollectionViewCompositionalLayout that presents each section's items in a panel or card...
...here the blue area is a NSCollectionLayoutDecorationItem that is passed to the section via its decorationItems…
user814037
0
votes
1 answer
iOS Error: could not dequeue a view of kind: header with identifier headerReuseIdentifier
I'm learning compositional layouts and I'm unable to set the header for a section, this is my entire code
import UIKit
class ViewController: UIViewController {
private let collectionView: UICollectionView = {
let…

Shivacharan Reddy
- 25
- 4
0
votes
2 answers
How to set custom UICollectionView Cell Size
Hi Community I wanted to implement a UICollectionviewCell which have size of 110 and each row have 3 cells initially
1.) Now need to do some modification in such way firstRow should have 3 cells but the second should have 2 cells
2.) The first cells…

Sanjay Mishra
- 672
- 7
- 17
0
votes
1 answer
UICollectionViewLayout not fitting cells together
I have a UICollectionView with the following layout:
private func createCollectionViewLayout() -> UICollectionViewLayout {
let itemSize = NSCollectionLayoutSize(widthDimension: .fractionalWidth(0.49), heightDimension: .estimated(150))
let…

Moses Harding
- 51
- 5
0
votes
1 answer
Swift Compositional Layout Expanding Cell Causes Unwanted Offset Scroll Behavior
I'm wanting on creating expanding cells using Compositional Layout. An issue i'm facing is that every time when my cell expands, i'm getting this unwanted offset change occurring right after my expansion is complete (moving cells to the right). For…

Kenny Ho
- 409
- 3
- 16
0
votes
0 answers
How to change the background section
I have a collection view and I want to add a image to the background but I want that the imagen change depending the section.
I`m changing the header and I can modify the header depending the section but I can´t make the same with the background of…

Victor
- 9
- 2
0
votes
0 answers
UICollectionView OrthogonalScrollingBehavior make sticky header disappear
I'm trying to make collectionView with CompositionalLayout, and make certain cell always stay sticky to the top whether the other section appears or not.
Here is my code customizing UICollectionViewLayout
public final class…

devsw96
- 1
0
votes
1 answer
Scale cell according to visibility percentage
When a cell is fully visible at the center of the collection view, I want it to appear larger than the cells in the sides.
Currently, I'm utilizing visibleItemsInvalidationHandler closure to achieve that…

ED.
- 29
- 4
0
votes
1 answer
Invalid absolute dimension: inf. The dimension must be a finite value
Hi I tried to use compositional layout, while using stage manager rare the app getting crashed. Please refer below error message
Terminating app due to uncaught exception
'NSInternalInconsistencyException', reason: 'Invalid absolute
dimension: inf.…

iroh
- 23
- 5
0
votes
0 answers
UICollectionViewCompositionalLayout Tag Layout with Dynamic Cell Height
I am trying to achieve this kind of tag layout (collectionview cells with dynamic width and height) but code crashes with some constraint errors when the text for a label within a cell is very long. is there a way to have a label with multiple lines…

caa5042
- 166
- 3
- 16
0
votes
0 answers
Is it possible to vertical snap using UICollectionView CompositionalLayout?
(https://i.stack.imgur.com/KBqia.png)
I want to display a vertical snap like the image above by using UIColletionView CompositionalLayout.

Bun
- 1
0
votes
1 answer
Collectionview with multiple fullscreen sections and horizontal paging
I am trying to create a collectionview with multiple sections. Each section is full screen and has multiple cells. I am using UICollectionViewCompositionalLayout. The collectionview has horizontal paging where you can scroll from section to section…

caa5042
- 166
- 3
- 16
0
votes
0 answers
How to know exactly when the user scrolls to another carousel item on a carousel built with UICollectionViewCompositionalLayout?
Im having a hard time trying to get notified and consequently run code whenever my horizontal carousel built with UICollectionViewCompositionalLayout changes to another cell / carousel item (aka the user scrolls to another carousel item). Upon…

stompy
- 227
- 1
- 13