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?

183 questions
41
votes
5 answers

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

I have two sections in UICollectionView. I want to show a section header in UICollectionView for only 1st section. Not in 0th section. So I tried to return nil in viewForSupplementaryElementOfKind: method for section == 0 and returns view for the…
Dinesh Raja
  • 8,345
  • 5
  • 40
  • 78
40
votes
3 answers

Add a simple UIView as header of UICollectionView

I have a UICollectionView. I would like to add a header. My header would only be a UILabel. I've : 1) selected "Section Header" as a Collection View accessory in the IB. 2) created a Collection Reusable View in the IB, on the side, declared as…
Nicolas Roy
  • 3,453
  • 5
  • 22
  • 40
33
votes
5 answers

Allow A Header View for Only Certain Sections Using an iOS UICollectionView

The code below displays my header view correctly, but for each of the sections in the UICollectionView: -(UICollectionReusableView *)collectionView:(UICollectionView *)collectionView viewForSupplementaryElementOfKind:(NSString *)kind …
23
votes
6 answers

UICollectionView custom line separators

I wanna making 2pt black separators in UICollectionView for our new app. Screenshot from our app is below. We couldn't use UITableView, because we have custom insert/delete animations, scrolling and parallax effects and so on.
18
votes
3 answers

add custom header to collection view swift

I am trying to add header to collectionView using custom xib file. I created the xib file with class implementing UICollectionReusableView. In collectionViewController I registered the xib file like this: self.collectionView.register(UINib(nibName:…
Khaled Hayek
  • 435
  • 2
  • 5
  • 20
17
votes
1 answer

UICollectionReusableView - Missing return in a function

I had a weird problem running into considering a header of a UICollectionView. I basically used the code from: http://www.raywenderlich.com/78551/beginning-ios-collection-views-swift-part-2 func collectionView(collectionView: UICollectionView, …
longbow
  • 1,473
  • 16
  • 39
16
votes
5 answers

Remove space between sections in collectionview

How to adjust the spacing between sections of collection view.
12
votes
2 answers

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 that much problems on displaying the items/cells. My problem is that the viewForSupplementaryElementOfKind is not being…
12
votes
1 answer

update UICollectionView's header content without reloading whole section

i want to dynamically update the content of the header information in my UIColectionView but i do not want to reload the whole section because this i done very frequently. Any ideas for an elegant solution? Thanks
10
votes
1 answer

Prevent Sticky UICollectionView Section Header Getting Pushed Up by Section Footer

This is how I stick the sectionHeader to the top of collectionView when it scrolls (collectionView.collectionViewLayout as? UICollectionViewFlowLayout)?.sectionHeadersPinToVisibleBounds = true; The problem is that, when the header hit a footer,…
10
votes
3 answers

detecting when an iOS UICollectionCell is going off screen

I'm having a UICollectionView that holds pictures as elements in its datastore. I want to load a high resolution pic into the element only when its corresponding UICollectionViewCell is currently showing on screen. Later, when the…
10
votes
7 answers

UICollectionView & custom UICollectionReusableView not works

I'm trying to use custom UICollectionReusableView (which has own class and XIB) in my UICollectionView header. But after fetching data in the place of header I have nothing. My steps: Registering class in viewDidLoad: [self.collectionView…
Romowski
  • 1,448
  • 4
  • 23
  • 47
9
votes
1 answer

Register multiple header supplementary view in the same UICollectionView through storyboards

So I have a UICollectionView that I want to use to display multiple UICollectionViewCells and different headers depending on the state the user is in. The problem is I can't seem to register multiple UICollectionResuableView (header) views within…
9
votes
4 answers

Issues inserting into UICollectionView section which contains a footer

I've got a typical UICollectionView which is using UICollectionViewFlowLayout in a vertical fashion. I'm using a rest API with pagination to populate the collection view. In order to trigger the next page to download, I'm using the delegate when it…
8
votes
1 answer

iOS 7 - UICollectionElementKindSectionHeader crashes app ('UICollectionView dataSource is not set')

Trying to add a section header to my uicollectionview. When I don't use a section header, collection view loads fine, no problems at all. When I try to use one, I get this error: *** Terminating app due to uncaught exception…
JimmyJammed
  • 9,308
  • 17
  • 74
  • 140
1
2 3
12 13