Top "Uicollectionviewlayout" questions

The UICollectionViewLayout class is an abstract base class that is used to generate layout information for a collection view.

Horizontal UICollectionView single row layout

I'm trying to setup what should be a simple horizontal layout using UICollectionView, going around in circles without achieving the …

ios objective-c uicollectionview uicollectionviewlayout horizontalscrollview
What is a 'UIView-Encapsulated-Layout-Width' constraint?

I keep getting 'Unable to simultaneously satisfy constraints' exceptions (Xcode 5, iOS 7, both device and simulator), where one of the constraints …

ios uicollectionview autolayout nslayoutconstraint uicollectionviewlayout
UICollectionView with two headers

Having two headers in UICollectionView? I've got a UICollectionView which uses the flow layout, which also has a header and …

iphone ios objective-c uicollectionview uicollectionviewlayout
How to set the position of cells on UICollectionView

I have an UIViewController which contains a UICollectionView. But the UICollectionView does not fill all the UIViewController. I find that …

ios uicollectionview uicollectionviewlayout
UICollectionViewLayout layoutAttributesForElementsInRect and layoutAttributesForItemAtIndexPath

I'm implementing a custom flow layout. It has 2 main methods for overriding to determine placement of cells: layoutAttributesForElementsInRect and layoutAttributesForItemAtIndexPath. …

ios objective-c uicollectionview uicollectionviewlayout uicollectionviewdelegate
How to add an UICollectionViewLayout programmatically?

I'm trying to setup a UICollectionViewLayout programmatically. I'm using a UICollectionView also without using storyboards, as well as settings its …

swift uicollectionview uicollectionviewlayout pinterest
iOS 10/11 UICollectionViewFlowLayout using UICollectionViewFlowLayoutAutomaticSize results in footer supplementary view misaligned

So this is an interesting issue we found with UICollectionViewFlowLayout on iOS 10 (still an issue on 11) and using UICollectionViewFlowLayoutAutomaticSize for …

ios uicollectionview uicollectionviewlayout
Warning: UICollectionViewFlowLayout has cached frame mismatch for index path 'abc'

This is the code causing the warning: private override func layoutAttributesForItemAtIndexPath(indexPath: NSIndexPath) -> UICollectionViewLayoutAttributes? { let attributes = super.layoutAttributesForItemAtIndexPath(…

ios swift uicollectionview uicollectionviewlayout
viewForSupplementaryElementOfKind not being called on custom UICollectionViewLayout

I created a custom UICollectionViewLayout and I've put it in my Collection View Controller in the storyboard. I didn't get …

ios objective-c uicollectionview uicollectionviewlayout uicollectionreusableview
sizeForItemAtIndexPath is not found in different swift versions

I am using UICollectionView but following method not found: func collectionView(collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAtIndexPath indexPath: NSIndexPath) -&…

swift swift3 uicollectionview swift4 uicollectionviewlayout