testing testing - 9 months ago 89
iOS Question

Disable supplementary view

What is the correct of of disabling the supplementary views (e.g. header)? One time I want to show them (iPhone) and one time I don't want to show them (iPad).

The only idea I currently have is to return a size of zero in

. But I think it's kind of an overhead to create views, which aren't used at all. On the other side I have to implement
and I can't return
, because the app crashes then.

How can I disable the supplementary views in

feb feb
Answer Source

If you return CGSizeZero from collectionView:layout:referenceSizeForHeaderInSection: delegate method collectionView:viewForSupplementaryElementOfKind:atIndexPath: won't be called.