ios - UICollectionView displays cells incorrectly after frame change -
i noticed if change frame of uicollectionview (e.g. when toggling in-call status bar), collection view doesn't update cells new frame. it's easiest see in short video:
http://cl.ly/2t2y2a3a2w1d/collectionviewtest.mov
the source files simple test here:
http://cl.ly/0s0a360b3i3q/collectionviewtest.zip
it doesn't seem matter whether use uicollectionviewcontroller or uiviewcontroller. has seen this? missing something? workaround i've found call reloaddata on collection view in view controller's viewwilllayoutsubviews or viewdidlayoutsubviews works far ideal when collection view's frame being affected user drag since reloaddata called many times , results in sluggish ui updates while user dragging.
i had similar problem, uicollectionview
's frame
changed , unless call reloaddata
got stuck in same spot without moving collectionview
.
i've fixed adding collectionviewflowlayout:
- (bool)shouldinvalidatelayoutforboundschange:(cgrect)newbounds { return yes; }
worked nicely.
Comments
Post a Comment