Questions tagged [uicollectionreusableview]

The UICollectionReusableView class defines the behavior for all cells and supplementary views presented by a collection view.Available in iOS 6.0 and later. It should be tag only issues related with [tag:uicollectionreusableview].

UICollectionReusableView : Reusable views are so named because the collection view places them on a reuse queue rather than deleting them when they are scrolled out of the visible bounds. Such a view can then be retrieved and repurposed for a different set of content.This is declared in Apple's UIKit framework and available in iOS 6.0 and later

This class is intended to be subclassed. Most methods defined by this class have minimal or no implementations. You are not required to override any of the methods but can do so in cases where you want to respond to changes in the view’s usage or layout.

Source: UICollectionReusableView Class Reference

Related tags:

Related Stack Overflow questions:

  1. Removing empty space, if the section header is hidden in the UICollectionView

  2. How to detect scrolling to a new section in a UICollectionView?

191 questions
2
votes
2 answers

CollectionView header doesn't resize on auto rotate

I have a headerView in my CollectionView and have resized the headerView programmatically based on the text size of the Label. On rotating to landscape orientation the reusable header view doesn't resize automatically but on scrolling it resizes…
bachman
  • 690
  • 7
  • 22
2
votes
0 answers

Reload UICollectionView Footer Size

Im trying to accomplish a comment UITextView similar to Instagrams. I previously did this with UITableView and used beginUpdates and endUpdates to reload the footer size as the user enter their comments. With my collectionView I've tried a few…
Peter
  • 1,053
  • 13
  • 29
2
votes
1 answer

How to add few UICollectionReusableView

I have two different view that I need to implement in UICollectionView. My question is how can I add two UICollectionReusableView to UICollectionView using storyboard? For example I can add it as source code: [self.collectionView…
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
2
votes
0 answers

UICollectionViewCells dequeued in wrong order

I am hooking up a standard UICollectionView with custom cells. Long story short, when I reload the collectionView, the cells are not dequeued in the order that they were created in. EX. The cell for indexPath.row 5 is given back for indexPath.row…
1
vote
1 answer

UICollectionView can't get supplementary views

For the first time I'm trying to make use of section headers in a UICollectionView in Xamarin.iOS following the Microsoft Guide and some other resources. When the UICollectionView loads a section header, all outlets connected to the view of the…
1
vote
2 answers

Unable to display thumbnails in UICollectionView

I am trying to recreate this thing. I've created in Storyboard skeleton. Here's the idea of my code: Fetch images from URL's array with help of the function getThumbnailFromImage Add UIImage's with my thumbnails in array webImages Add in…
user19727360
1
vote
1 answer

Overlapping text in uicollection view headers for different sections

I added different text labels to my collectionview headers for each section in swift.I use uireusableviews for headers. My problem is when I scroll the text in the labels of different sections overlap with each other.I tried setting the text label…
1
vote
1 answer

Collection cell removes item on each reloadData() call Swift 5

Please see below image, that is my correct and initial view. But after reloadData() is called for collectionView then it is removing the "COMPLETED" status label, and if I again repeat that action it will remove the "PROCESSING" status label. Does…
1
vote
1 answer

What is the section number of a supplementary view?

I'm working with UICollectionViewController. At some point In need to make some configurations to the visible footers and for each one of them, I need to know its' current section number. Current because sections may be replaced and the section of a…
Sanich
  • 1,739
  • 6
  • 25
  • 43
1
vote
0 answers

Issue using reusable cell in collection view

I am adding a collection view programmatically. And every time I try to return a cell, I keep getting this error: *** Assertion failure in -[UICollectionView…
Parth
  • 2,682
  • 1
  • 20
  • 39
1
vote
1 answer

Header view of UICollectionView keeps duplicating on scroll - How to create fixed (non-sticky), single collection view header?

I wanted to implement a view hierarchy like the following so that the ENTIRE view would be scrollable: UIScrollView Image View Collection view But a lot of people on here have said that it is better to use the header that comes along with the…
1
vote
2 answers

Trying to Add a CollectionView to ResuableView Header like Instagram or SNapchat

I want to have a CollectionView in my Header that resembles that on Instagram and Snapchat for my main CollectionView which would be the feed. When I try to add the collectionview from the library and set the header as delegate and datasource after…
1
vote
0 answers

UICollectionView header affects to prefetch items

When using UICollectionViewFlowLayout's sectionHeadersPinToVisibleBounds = true in UICollectionView, UICollectionViewDataSourcePrefetching's func prefetchItemsAt indexPaths always repeats indexPaths, like: collectionView(_:prefetchItemsAt:) [[0, 4],…
1
vote
2 answers

Calling `reloadItems(at:)` causes program to crash

I am trying to create a program which dynamically updates the collectoinView as the user enters text into the UITextField. Below is the extension I have created to achieve this I have updated code based on your suggestions to include insert and…
1
vote
2 answers

Label Overlapping in CollectionView

I have implement the collection view with image and labels. The Image is working fine but labels are overlapping. I have implemented all the required methods but unable to find the problem for label overlapping. My Code is provided below -…