Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UICollectionViewCell sizing issue on iOS 7 when building with iOS 8 SDK: is it a bug?

I started to build my iOS apps for iOS 8 and I quickly found out there was an issue with the UICollectionViewCell whatever you use a custom collection layout or not. Many cells were not shown properly, content was cut off, etc.

Quick fix: add the following autoresizing mask to the content view of your cells:

self.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;

This wasn't happening when I was build with the iOS 7 SDK. It also doesn't happen when building with iOS 8 SDK and running on iOS 8.

Is this a bug or is there something different to do since iOS 8?

like image 890
Alexis Avatar asked Sep 12 '14 07:09

Alexis


1 Answers

Thanks for the info! I was also bitten by this and Your workaround brought some order to the chaos. There is a lot of changes in both collection view and table views in iOS 8 to support self-sizing cells, and bug are expected. My guess is that previously the cells had this autoresizing behavior by default, and now Autolayout is the new way to go and the older path is not tested as much...

like image 64
Janne Avatar answered Jan 05 '23 02:01

Janne