ios - UICollectionView size: iOS9 vs. iOS8 -
in app want compute best cell height cells match visible area.
what best way size of visible rect? mean space between navigationbar , bottom of screen.
currently size
self.collectionview!.frame.size
but contains area of statusbar , navigationbar. substract size of nav- , stautusbar. works ios9, not on ios8.
so, how visible area devices?
not answer, workaround, detect ios version , apply modifications according it:
if ( ([[[uidevice currentdevice] systemversion] compare:@"9.0" options:nsnumericsearch] != nsorderedascending) ) { /* ios 9.0 or greater */ }
of course, better define layouts using constraints relative top layout guide (ideally using opaque navigation bar) avoid messing that, or add 20 points top constraints when detecting ios versions.
Comments
Post a Comment