The UICollectionViewDelegateFlowLayout protocol defines methods that let you coordinate with a UICollectionViewFlowLayout object to implement a grid-based layout. The methods of this protocol define the size of items and the spacing between items in the grid.
Questions tagged [uicollectionviewdelegateflowlayout]
33 questions
0
votes
0 answers
How to populate a collection view from the ground up - swift - programmatically
I'm developing a chat view controller and in doing so I need to present the latest messages whenever I load the controller:
I'm using a collectionView with cells layout one on top of the other.
This Is the method I implement and it works, but is not…

StackGU
- 868
- 9
- 22
0
votes
0 answers
How to make single row collection view cell with dynamic button width
Guys I'm working on a project and I want to make a navigation bar like this enter image description here
here I knows there navigation bar is transparent and below navigation bar there must be a collectionview or scrollview I want to know how to…

Murtaza Mehmood
- 47
- 5
0
votes
1 answer
Dynamic UICollectionView Cell Height
I have an array of stack views with varying heights:
[Stack View A, Stack View B, Stack View C, Stack View D]
I want to display them in a collectionView. Every stackView goes into a different collectionView cell. I am currently using a flow layout…

Bilbo Baggins
- 3,644
- 8
- 40
- 64
0
votes
1 answer
Why does the UICollectionView's delegate methods don't work?
I created a collectionView and I made it's delegate conform to UICollectionViewDelegateFlowLayout protocol attached to the main ViewController in order to modify some aspects of the UICollectionView's cells.
Initially I did this:
override func…
user12145455
0
votes
1 answer
Constraint not updated after using UICollectionViewDelegateFlowLayout
I'm using UICollectionViewDelegateFlowLayout to make my size and height of the collectionViewCell but when I use this one, the constraint in the cell are not updated.
func collectionView(_ collectionView: UICollectionView, layout…

Makaille
- 1,636
- 2
- 24
- 41
0
votes
1 answer
UICollectionViewDelegateFlowLayout is not changing cell bounds
I have problem with setting shadow path for UICollectionViewCell which has a relative width to collectionView bounds.
Im using storyboard constraints, setting up shadow in AwakeFromNib method and resizing cell with sizeForItemAt method
//cell…

Alikhan_msb
- 37
- 1
- 2
- 7
0
votes
1 answer
UICollectionView with 3 columns doesn't produce the desired result
I'm testing this on iPhone XR simulator. I have 3 rows of images and I want them displayed in 3 columns, 2 points distance top, left, right and bottom. This used to work but for some reason it doesn't now.
extension ProfileVC :…

Dani
- 3,427
- 3
- 28
- 54
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
1 answer
Space between collection view cells is always 0
I am trying to have a space between my cells, but for some reason it is always 0. What am I doing wrong?
import UIKit
class AlbumPlayerProgressBar: UICollectionView {
...
required init?(coder aDecoder: NSCoder) {
…

Luda
- 7,282
- 12
- 79
- 139
0
votes
2 answers
CollectionViewLayout Height
I want to custom a lot of layout size for each row of my collectionView by using UICollectionViewDelegateFlowLayout like below:
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout,…

Brorsoeu.Sen
- 3
- 2
0
votes
1 answer
ItemSelected not called - Xamarin.iOS F#
I have a UICollectionViewController defined as follows:
[]
type LandlordHome (handle:IntPtr) =
inherit UICollectionViewController (handle)
override x.ViewDidLoad () =
base.ViewDidLoad ()
…

Alk
- 5,215
- 8
- 47
- 116
0
votes
1 answer
Collection View Cell leaving space on top
I am using a collection view with different cell sizes in vertical scroll mode. I want the cell to appear like these as shown in the image.
Required Image
But the collection view cell appears like this with extra space on top.
Image from my…

udbhateja
- 948
- 6
- 21
0
votes
1 answer
Header Section not displaying in collection view programatically
Here is the code that i have
import UIKit
class UserProfileController : UICollectionViewController, UICollectionViewDelegateFlowLayout{
override func viewDidLoad() {
super.viewDidLoad()
collectionView?.backgroundColor =…

NojDavid
- 89
- 1
- 10
0
votes
0 answers
UICollectionView with dynamic size - layout flow delegate called for every single indexPath
I have a collection view in which its cells resize dynamically depending on image orientation, label content etc.
This works perfectly and is basically achieved through the flow layout delegate method below.
extension TimelineViewController:…

Rog
- 18,602
- 6
- 76
- 97
0
votes
2 answers
Same margin between cell uicollectionviewflowlayout
I've been searching on google & stackoverflow for a while trying to accomplish a fairly simple action on my UICollectionViewCells but until now I've not been able to do it.
What I want to have is a CollectionViewController with two cells for each…

neteot
- 933
- 1
- 12
- 33