Questions tagged [uicollectionviewflowlayout]
209 questions
1
vote
0 answers
How to create specific UICollectionViewCompositionalLayout with non-interleaving NSCollectionLayoutGroup
I attempting to create UICollectionView like on picture above, using UICollectionViewCompositionalLayout.
I don't want split it to sections, because I'm using pinned SectionHeader and during scrolling another sections hiding my SectionHeader.
Here…

zslavman
- 401
- 5
- 11
1
vote
0 answers
How to implement the "tags layout" using UICollectionView iOS Swift?
I am trying to implement the Tags Layout using UICollectionView.
It works fine but only at some places the word is not displayed properly (Cropped) (mostly at the end of the UICollectioView frame). I have attached the screenshot as well.
I followed…

Kishor Pahalwani
- 1,010
- 1
- 23
- 53
1
vote
2 answers
UICollectionView crashes when item size is automatic and header is shown
I encounter a weird error that when I want to set the estimatedItemSize property of the UICollectionView to UICollectionViewFlowLayout.automaticSize and show a section header at the same time.
With the below code, the app can show the…

Myrick Chow
- 332
- 1
- 6
- 16
1
vote
0 answers
How to smoothly animate transition cells in uicollectionview in custom flowLayout
I want to create an app that shows an array of photos with captions (for now I have empty circles) that are arranged in horizontal uicollectionview. I want to make one larger circle to be displayed in the center of the screen, but the remaining…

Siemaszefie
- 53
- 1
- 5
1
vote
0 answers
Using `sectionHeadersPinToVisibleBounds` while a `UIRefreshControl` is refreshing causes incorrect position of sticky headers
When using a UICollectionView with a UICollectionViewFlowLayout that has sectionHeadersPinToVisibleBounds set to true the sticky headers will be positioned incorrectly when a UIRefreshControl added to the collection view is refreshing.
Example view…

Joseph Duffy
- 4,566
- 9
- 38
- 68
1
vote
0 answers
Access CollectionView Cell Content (change width of inner view)
I want to have a uiview as cell background with changing width. This should be used as a progress-/ statusbar.
The problem:
I can’t change the width of the statusbar from my collectionViewController (only from the CollectionViewCellController)....
I…

MunichCoder
- 143
- 1
- 9
1
vote
0 answers
Swift: CollectionView alternating cell number per row
I am trying to emulate a hopscotch board pattern in my collectionView that will require a repeating 1-2-1 configuration (Example below), but cannot see any way to implement it. The pattern is required in 3 different sections of my collectionView.…

Ryan Hampton
- 319
- 1
- 4
- 21
1
vote
1 answer
UICollection spacing not working I Don't wont any spacing in uicollectionview
I have tried following but not working
self.hCltVw.constant = (rowHeight * 8.0)
let layout: UICollectionViewFlowLayout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal
layout.sectionInset =…

Jaydeep Vyas
- 4,411
- 1
- 18
- 44
1
vote
1 answer
Unable to simultaneously satisfy constraints. Adaptive cell height using UICollectionViewFlowLayout
I'm trying to make a news feed like app using UICollectionView with adaptive cell height. I found this tutorial and used the option "2. Solution for iOS 11+" for my code, which works perfectly fine. However, whenever I try to add more subviews to…

Andrey
- 25
- 4
1
vote
1 answer
collectionView cellForItemAtIndexPath called only one time -swift - programmatically
I have a collectionView that I set with this delegate and datasource:
extension CardView : UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout{
func collectionView(_ collectionView: UICollectionView,…

StackGU
- 868
- 9
- 22
1
vote
1 answer
UICollectionView horizontal paging not centring after rotation
I am currently working on a horizontal gallery scroll view. I have decided to use UICollectionView with horizontal paging enabled. It almost works great... expect on rotation the collection view cells are not centred (see screenshot attached),…

MKodes
- 81
- 9
1
vote
0 answers
Spacing between the cells as per the label width in horizontal CollectionView in case of 2 rows
As shown above,I want two fixed horizontal rows, with labels width according text and spacing between cells same as I’m getting in a single row.
(Please refer Image Url)
I’m unable to achieve the same in case of two horizontal rows.
I used…

Shubham Yadav
- 11
- 3
1
vote
1 answer
Apply UICollectionViewDelegateFlowLayout on specific Collection View in View Controller with multiple Collection Views
I am designing a screen where I have 3 Collectio Views.
@IBOutlet weak var colorCollectionView: UICollectionView!
@IBOutlet weak var sizesCollectionView: UICollectionView!
@IBOutlet weak var imgCollectionView: UICollectionView!
I wanna apply some…

M. Mubeen Asif
- 107
- 1
- 7
1
vote
1 answer
CollectionView using NSDiffableDataSource with UICollectionViewFlowLayout
When I use UICollectionView with UICollectionViewFlowLayout set. And then try to apply snapshots of datasource via
// load initial data
reloadDataSource()
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(3)) {
…

Michał Ziobro
- 10,759
- 11
- 88
- 143
1
vote
0 answers
Items in UICollectionView with custom UICollectionViewFlowLayout show items beneath each other instead of in a grid
I'm currently working on an app where we need to show items in a grid, with a fixed number of columns. So a UICollectionView with a custom UICollectionViewFlowLayout is great for this!
I created the following custom UICollectionViewFlowLayout that…

Charlotte1993
- 589
- 4
- 27