Search code examples
cocoa-touchuiscrollviewxcode6

Scrollable Content Size Ambiguity with empty UIScrollView (XCode 6)


In my project, I have multiple empty scrollview (layout with AutoLayout) in multiple view controllers. At run time, views will be add to those scrollview base on user and their desirable content. This was fine in XCode 5, IB editor never show any warning.

Recently when I update to XCode 6 to gain access to iOS 8 and new iPhone simulators. I found that all those empty scroll view that used to be ok (no warning in XCode 5) now showing warning of scrollable content size ambiguity. I check my AutoLayout and it seems ok.

Any idea what cause this?

P.S. but every thing seems ok when I run with simulator and device, no layout issue.


Solution

  • According what you describe the ambiguity is solved in run time, so when you are designing in IB this constraints don't exists.

    If you want to avoid this warning you can set intrinsic size to Placeholder in IB as shown:

    enter image description here