Issue with Auto Layout on iOS 8 (code works perfectly on iOS 7)

后端 未结 2 733
南笙
南笙 2020-12-05 01:16

I have an app that was built using auto-layout and everything still works as expected when I run it on my iOS 7 device, however when I run it on an iOS 8 device

相关标签:
2条回答
  • 2020-12-05 01:26

    This is definitely an iOS 8 bug. I was able to work around it by sending setNeedsLayout to the container view (the superview of the image view).

    I see that you're sending setNeedsLayout to self.view. If that code is in your view controller, then I guess self.view is not the container view. Try sending setNeedsLayout to the container view directly.

    Demo project is here.

    enter image description here

    0 讨论(0)
  • 2020-12-05 01:32

    Try using UIViewContentModeScaleAspectFill and setClipsToBounds:NO

    0 讨论(0)
提交回复
热议问题