iOS 9.1 UIScrollView leaving blank space
Asked Answered
E

1

7

I have a ViewController with a hierarchy as follows:

  • UIViewController
    • UIView
      • UIScrollView
        • UIView
          • UIImageView
          • UILabel

The layout is such that the UIScrollView fills the screen. There is no extra logic executed on this ViewController, such as programatic scrolling, listening to scrolling, etc.

When I run this on an iOS 9.0 simulator, the layout is correctly inflated, with the UIImageView drawn flush against the top margin.

But when I run this on an iOS 9.1 simulator, there is initially a large whitespace between the top margin and the image. Upon touching the UIScrollView it corrects itself, scrolling that the UIImageView is flush against the margin.

Setting automaticallyAdjustsScrollViewInsets does not have an effect (presumably because the scrollview isn't at my root).

My question is: What is different about iOS 9.1 scrollviews that it would be causing this, and what is the work around? Its bothering me since this isn't exactly a complex layout I'm trying to use.

Edit

Screen shot of my hierarchy and the constraints applied to them, maybe it helps. constraints

Ethelind answered 5/11, 2015 at 6:41 Comment(2)
check auto layout constraints, I think constraint is breaking.Heterophyllous
There are no error messages in the console about breaking constraints. I'll add a screen shot of the constraints if that helps.Ethelind
W
0

I think the issue might be the hight constraints. try getting rid of them and add them back in, one at a time as needed.

Weakfish answered 12/11, 2015 at 17:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.