My app has a UIViewController with a container view that fills the entire screen. The container view embeds a UICollectionViewController. These view controllers should scroll under and show through below the status bar. In order to achieve this, I've set the UICollectionViewController.contentInsetAdjustmentBehavior = .never. As I scroll the collectionview and the top of cells scroll under the status bar, the contents of the cell shrink. This is incorrect. I just want them to scroll under the status bar as they did in iOS 10.3.
I have developed a small test app that exhibits my bug and uploaded it as a bug report. It looks so broken that I can't imagine how others haven't see the same issue.
Small test project here: https://github.com/murthyveda2000/ios11bug
This feels like a total hack, and I hope this is actually a bug that Apple will fix (but I'm seeing it in the Xcode 9 GM so I'm less optimistic) but I was able to fix this on your sample project with:
cell.contentView.insetsLayoutMarginsFromSafeArea = false
In an app with more complex layouts, I've also had to apply this to subviews that use layout margin guides.
This probably has unintended consequences and will look like a very bad answer in a week. I suspect if you support rotation, this might screw things up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With