Decoration View *above* cells in UICollectionView
        Posted  
        
            by 
                Dhiraj Gupta
            
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Dhiraj Gupta
        
        
        
        Published on 2012-10-15T15:34:49Z
        Indexed on 
            2012/10/15
            15:37 UTC
        
        
        Read the original article
        Hit count: 417
        
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.
© Stack Overflow or respective owner