0

I am developing an app that supports iOS7 and iOS8. On iOS8 running on an iPad 2 the app runs fine. No issues. However on iOS7 there is an issue with one of my UICollectionView's which I just can't seem to fix. I am using AutoLayout and out of desperation, have tried springs and struts which made no difference.

So this is how the cell looks at 320 width:

320 Width

Here are the AutoLayout constraints applied to the UICollectionView

Autolayout constraints

And here is what happens when its on an iPad with iOS 7.1

iPad + iOS7

Whatever I try I always get the same result on iOS7. On iOS8 with an iPad the cell displayed perfectly fine.

Not sure what is going on here.

Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99

1 Answers1

0

Right, so I found the answer incase anyone else suffers the same issue.

The accepted answer from this SO question: Auto layout constraints issue on iOS7 in UITableViewCell

Actually helped me.

Here is what i did in my UICollectionViewCell's subclass:

    -(id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];

    if (self){

        self.contentView.autoresizingMask = UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth;


            return self;
    }
    return nil;
}

This solved the issue for me.

Community
  • 1
  • 1
Robert J. Clegg
  • 7,231
  • 9
  • 47
  • 99