Auto Layout in UICollectionViewCell not working

Well, I just looked on the iOS developer forums. Apparently, this is a bug with the iOS 8 SDK running on iOS 7 devices. The workaround is to add the following to your subclass of UICollectionViewCell:

- (void)setBounds:(CGRect)bounds {
    [super setBounds:bounds];
    self.contentView.frame = bounds;
}
override var bounds: CGRect {
    didSet {
      contentView.frame = bounds
    }
}

Leave a Comment