The effect I'm trying to achieve is a kind of sticky header cell. Itβs important for me that a sticky cell floats over others. Something like that:
ββββββββββββ β β β Cell 0 β β ββ ββ¬βββββββββββ β Cell 4 β β β ββββββββββββ ββββββββββββ β β β Cell 5 β β β ββββββββββββ ββββββββββββ β β β Cell 6 β β β ββββββββββββ
Cells 4, 5, and 6 will display normally, and I'm building the attributes for cell 0 in my subclass of UICollectionViewFlowLayout during layoutAttributesForElementsInRect: All I do is call the super implementation, determine which cell I need to add, and then build the UICollectionViewLayoutAttributes(forCellWithIndexPath:) . Then I set zIndex to 1 (default is 0 ).
The problem I get is that the UICollectionView seems to always ignore zIndex
ββββββββββββ β β β Cell 0 β ββββββββββββ΄β ββ€ β β Cell 4 β β β ββββββββββββ ββββββββββββ β β β Cell 5 β β β ββββββββββββ ββββββββββββ β β β Cell 6 β β β ββββββββββββ
Now I believe that it is possible to visually sort this using the 3D transform, but this does not work for me, since I do not want taps to come across in the cell located on top. Thus, in this example, I do not want Cell 4 to receive taps designed for Cell 0.
Does anyone have any ideas? This is on iOS 8.4.
source share