ios - Adding a static background to a uicollectionview -


is possible add static background collectionview because @ moment background scrolls cells , image looks quite bad.

my code @ moment

collectionview.backgroundview = [[uiimageview alloc] initwithimage:[uiimage imagenamed:@"bg.png"]]; 

there 2 ways you're asking.

  1. add background uicollectionview subview you're doing , implement scrollviewdidscroll: delegate method. inside method, set frame of background view based on contentoffset of collection view make appear static on screen. need set frame's y origin contentoffset.y , should work. (if there non-zero contentinset may need bit of additional math right.)

  2. add background superview of collection view, underneath collection view. easier , more efficient solution since don't need mess contentoffset @ since background not in scroll view itself.


Comments

Popular posts from this blog

javascript - jquery or ashx not working -

opencv - DataType<cv::detail::deriv_type>::depth what is it used for -

python 3.x - Mapping specific letters onto a list of words -