简体   繁体   中英

UICollectionVIew not displaying cells adequately on ios7 although works fine on is6

I have a simple implementation of a UICollectionView with default layout that works fine on iOS6 . When transitioning the code on iOS7 , the default UICollectionViewFlowLayout seems not to work: all the cells are located on the top left corner at the exact same locations (one on top of the others).

Note that I do not update cell.frame.origin, nor cell.center in:

(UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {} 

Am I wrong? What should I do it?

Thank you in advance

I understood my problem:

I had the follwoing line in my code:

   [cell.layer setPosition: CGPointMake(-5, -5)];

which explains why the cell was located at the top left corner.

But strangely, when running on ios6, this line had no effect (and that's why I even forgotten it was there) whereas it does have on ios7.

I simply delete the line, and now everything is running fine on both ios6 and ios7.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM