Questions tagged [uicollectionviewflowlayout]
209 questions
0
votes
0 answers
UICollectionViewCell in UICollectionViewFlowLayout duplicate rows
ANSWERED by Starsky
I am trying to build a view with several horizontal scrollable lists populated with 12 cells in the same row. The problem is that that the cells show up "in two rows in the same row". To clarify, the row is split into two rows…

Casper Lindberg
- 600
- 1
- 6
- 21
0
votes
1 answer
UICollectionView Location for Supplementary Header
I am looking to put a header on my collection view's sections. I have a collectionview embedded inside a tablebview. Using the section headers of the tableview puts the header too far from the content. Putting the section header as part of the…

C6Silver
- 3,127
- 2
- 21
- 49
0
votes
0 answers
UICollectionView with different layouts in each section
I have a UICollectionView where I want to have a specific height of the cells in the section 0 and section 1. In section 2 I want two cells to look like this:
Cell 1 - Cell 2
Cell 3 - Cell 4
Cell 5 - Cell 6
The height of the CollectionViewCells in…

JMIT
- 169
- 2
- 15
0
votes
2 answers
CollectionView with multiple different cells, registered in other CollectionViews
I have two separate view controllers.
In ViewController1, I have a CollectionView1 and a cell that works fine. I set up the cell using storyboard with ReuseIdentifier "Cell1".
In ViewController2, I have another CollectionView2 and a different cell…

nicksarno
- 3,850
- 1
- 13
- 33
0
votes
4 answers
UICollectionViewCell width is bigger than what I set in sizeForItemAt
Width/height of my UICollectionView matches all available space.
I want to display two cells in one row (two columns)
So width of one cell should take half width of UICollectionView (collectionView.frame.width / 2)
So I programmatically change width…

user924
- 8,146
- 7
- 57
- 139
0
votes
1 answer
UICollectionView horizontal paging layout
Hy, I'm trying to achieve this UI element, that it seems (to me) like an horizontal UIPickerView. Here is an example GIF from when creating a "memoji" on iOS:
Example GIF
I have been trying to accomplish this with UICollectionView and a custom…

Diogo Antunes
- 2,241
- 1
- 22
- 37
0
votes
4 answers
Clip last UICollectionViewCell if their total width is greater the UICollectionView width
I have a scenario where I have a horizontal scrolling collection view has a number of X cells. The default width of the cell is 71 points.
Depending on the value of X, I might have less cells when their total width is less than the width of the…

trusk
- 1,634
- 2
- 18
- 32
0
votes
1 answer
Actual performance of UICollectionView is really bad
I am currently working on a project and basically, I am still learning.
I was using at the beginning a UITableView, but I needed automatic height and 2 or 3 columns (depending on the device).
For the columns, I am using UICollectionViewFlowLayout.…

Amg91
- 165
- 8
- 25
0
votes
0 answers
iOS - UICollectionView dynamic height
I've defined my flow layout as follows
internal lazy var layout: UICollectionViewFlowLayout = {
let layout = UICollectionViewFlowLayout()
layout.minimumLineSpacing = 16
layout.sectionInset = UIEdgeInsets(top: layout.minimumLineSpacing,…

Hons
- 3,804
- 3
- 32
- 50
0
votes
0 answers
Collection view with autosizing cells stops working after reloading
In my app I have a collection view with cells autosizing horizontally.
Here's some code:
// called in viewDidLoad()
private func setupCollectionView() {
let cellNib = UINib(nibName: SomeCell.nibName, bundle: nil)
…

Yevgeniy Leychenko
- 1,287
- 11
- 25
0
votes
1 answer
UICollectionView Cell Custom FlowLayout Breaks When New Post is Added on Top
Description:
I have been working on an app which displays images and caption in a CollectionView. I have made a custom Cell and CustomFlowLayout for the cell where the width of the cell, image and caption is equal to width of screen and height will…

shree bhagwat
- 392
- 2
- 11
0
votes
1 answer
Self sizing images in collection view cell
I want to add photos to one of my collection view cells similar to how snapchat does...
There are only two main requirements:
The amount of photos will vary so the overall cell height must also vary.
Each photo should maintain its aspect…

Stefan
- 908
- 1
- 11
- 33
0
votes
2 answers
Specify concrete cell sizes in UICollectionViewController?
I have a storyboard with UICollectionViewController with cell prototypes. The cell size is not specified directly and it causes random UI bugs like stretching cell animation. I want to set the size directly but I didn't found how to do that in xcode…

Vyachaslav Gerchicov
- 2,317
- 3
- 23
- 49
0
votes
0 answers
Carousel Layout Collection View Issue
Hello, I have followed raywenderlich video for collection view custom
layout. UICollectionViewFlowLayout is subclassed as below
import UIKit
class CharacterFlowLayout: UICollectionViewFlowLayout {
let standardItemAlpha: CGFloat = 0.5
let…

Karthik K Manoj
- 11
- 1
0
votes
2 answers
Collection view first cell size issue
i have to hide some of the cells of uicollectionview based on my api response.
i am setting cell size to zero in collectionview's sizeForItemAtIndexPath method based on my json response value.
but even after setting the size to zero the cell which…

Jaimin
- 141
- 10