Questions tagged [uicollectionviewflowlayout]
209 questions
2
votes
0 answers
UICollectionViewDelegateFlowLayout has black portions/areas when adding views to it
I want to build kind of a split screen.
I used UICollectionViewFlowLayout for this.
When I add and remove UIViews to and from the screen I want the screen to be split into portions according to the number of views in the current screen.
So wrote the…

Janith Ganewatta
- 143
- 1
- 4
- 12
2
votes
0 answers
Carousel effect for Vertical scrolling UICollectionView
How to achieve Carousel Effect for a vertically scrolling UICollectionView? For example, we have 10 UICollectionViewCells aligned vertically in UICollectionView, assume if we are seeing the the 5th UICollectionViewCell, then 4th and 6th…

Harsha
- 760
- 1
- 7
- 21
2
votes
2 answers
Self Sizing CollectionView cell not work properly after reload data
I am creating a collectionView that can have multiple sections with a self-sizing cell.
it works nicely on the initial layout. but after reload, I encounter three problem
Scrolling become choppy
cell size changed and cell overlap with each…

Bhavesh.iosDev
- 924
- 9
- 27
2
votes
1 answer
UICollectionView doesn't show footer when using a custom flow layout
I have a UICollectionView, with header and footer enabled:
The height for the footer is set here:
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, referenceSizeForFooterInSection section:…

narner
- 2,908
- 3
- 26
- 63
2
votes
1 answer
UIViewAlertForUnsatisfiableConstraints errors when working with dynamic header size UICollectionView
Intro
I am trying to give the header cell of my collectionView a dynamic cell sizing. The cell that is used as a header is also used as a "regular" cell in another collectionView. In there, working with a dynamic cell sizing works just fine.
This is…

linus_hologram
- 1,595
- 13
- 38
2
votes
1 answer
Click on specific element in UICollectionViewCell not called(instead ItemSelected fired from Source) Xamarin.ios
I have a CollectionView in my Xamarin.iOS projet. I've a button inside my UICollectionViewCell and I'd like to have TouchDown on my button.
But when I click on this button, ItemSelected fired and not my TouchDown event handler (the global touch on…

ali
- 330
- 2
- 13
2
votes
1 answer
UICollectionView with two UICollectionViewFlowLayout
I'm working on a project in iOS, Swift. How Can we assign one collectionView with two different flow layout? Here I need my UICollectionViewCell to look like a stack-card, for that, I'm using CardsCollectionViewLayout(external pod…

Hilaj S L
- 1,936
- 2
- 19
- 31
2
votes
2 answers
In iOS 12, when UICollectionView is created using Self Sizing cells with constraints, upon reload layout has wrong height until I scroll
I have a weird issue in iOS 12 when using solution as explained here.
It works great when collection view loads for first time, however when I try to reload the collection view using either collectionView.reloadData() or…

Rajan Maharjan
- 1,137
- 2
- 12
- 22
2
votes
1 answer
Fix UICollectionView cells in screen dynamically
I'm working on an tvOS app, I want to fix all cells in tv screen without scroll vertically or horizontally. Here cells count will count is dynamic, that's the main problem. I want to set all cells like this
For example:
If cell count is 4
If cell…

Naresh
- 16,698
- 6
- 112
- 113
2
votes
1 answer
Auto sizing collection view cell size ignores auto layout on first display
Situlation
I made a horizontal scrolling collection view with UICollectionViewFlowLayout.automaticSize.
The collection view has height of 40
The cell has height of 40 which I set by autolayou on init.
Problem
The problem is that ONLY cells displayed…

Bigair
- 1,452
- 3
- 15
- 42
2
votes
1 answer
Height on UICollectionViewCell error when reload
I am basing the question as a branch of this question
The autosize on ViewCells works perfect. But when I reload my CollectionView, the height return 1.
Code as follows.
extension SaleViewController: CollectionViewFlowLayoutDelegate{
override…

Amg91
- 165
- 8
- 25
2
votes
2 answers
UICollectionview custom layout: some indexes have more visible cells than others?
I'm facing a weird issue that I can't seem to figure out or find anything about online.
So I'm trying to replicate the Shazam discover UI with a UICollectionView and a custom UICollectionViewFlowlayout.
So far everything is working pretty well, but…

JoniVR
- 1,839
- 1
- 22
- 36
2
votes
1 answer
Setup a collectionView with "tag"-like cells
I've been working on with a custom UICollectionViewFlowLayout to adjust the spaces between the cells so I can get a nice flow in my collectionView. But with my current code I can't figure out how I can adjust the cell sizes without "breaking" rows…

Jacob Ahlberg
- 2,352
- 6
- 22
- 44
2
votes
2 answers
UICollectionView cells lining vertically instead of grid
I am trying to create UICollectionView programatically, and my cells are getting stacked vertically instead of a grid form.
My code is:
let layout:UICollectionViewFlowLayout = UICollectionViewFlowLayout()
let screenSize: CGRect =…

Pritesh
- 139
- 2
- 12
2
votes
1 answer
How to left align UICollectionViewCells when scrolling horizontally?
I am trying to create a UICollectionView with cells that have varying widths but constant heights. The UICollectionView has 3 rows and scrolls horizontally.
Each cell should have 8px between the next cell to it's right and the row below. I have set…

Josh
- 254
- 3
- 19