Decoration View *above* cells in UICollectionView
- by Dhiraj Gupta
I've got a decoration view showing the way I want, in my UICollectionView. The position and size is right. The decoration view stays at the frame I'm setting for it in my layout.
But, I want the decoration view to be above the cells, not below them. I tried setting the zIndex property on the UICollectionViewLayoutAttributes for the decoration view, but this has no effect - I tried logging out the zindex of the cells, and they're all returning 0, and my decoration view's zIndex is set to 20.
I'm guessing having decoration views above the cells is not supported, at least in UICollectionViewFlowLayout? Someone please confirm this, thanks!
In the meantime, I'm going back to having a custom UIView subclass as a subview in the parent controller of the collection view and laying out the frame of it in the - (void) viewWillLayoutSubviews() method.