ios - UICollectionView with growing header view -


i have uicollectionview header of fixed size.

if pull down header moves down leaving gap above between header , nav bar. header has button @ top, couple of labels @ bottom , bg image.

if push header scrolls upwards display more of uicollectionview items.

this working fine. however, require change behaviour.

what want... want header start off same now.

enter image description here

pull down if pull down top of "header" should stick nav bar , header should grow.

i can making collection view frame smaller, faking header , accessing uiscrollviewdelegate methods in controller.

push up if push header should it's doing now. i.e. stay same size , disappear underneath nav bar.

this last bit tricky. if go proposed change pull down make harder.

question how can include both of these functions?

i'm thinking of maybe having header making blank?

another idea had... make collection view full screen set section inset has enough space fake header. can intercept scroll view delegate methods above?

i think sounds best unless has better idea?

can't make header desired (maximum) size keep hidden under nav bar calling scrolltoitematindexpath:atscrollposition:animated: in viewwillappear: of uicollectionviewcontroller?

as uiscrollviewdelegate controller take care of positioning upper right button @ desired position while scrolling.


Comments