Scrollable Content Size Ambiguity with Empty UIScrollView (Xcode 6)

In my project, I have several empty scrollviews (layout with AutoLayout) in several controllers. At run time, the views will be added to the scrollview database for the user and their desired content. This was good in Xcode 5, IB editor never showed any warnings.

I recently upgraded to Xcode 6 to access iOS 8 and the new iPhone simulations. I found that all those empty scroll views that were in order (without warning in Xcode 5) now show a warning about the ambiguity of the size of the scrollable content. I check my AutoLayout and it looks fine.

Any idea what this is about?

PS but everything looks fine when I run the simulator and device, without a layout.

+7
cocoa-touch xcode6 uiscrollview
source share
2 answers

As you describe, ambiguity is allowed at runtime, so when designing in IB, these restrictions do not exist.

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

enter image description here

+1
source share

1) Add a UIView inside scrollview.

2) Give the restrictions Leading, Trailing, Top, Bottom as 0.

3) Add two additional constraints for the UIView Center X and Y.

0
source share

All Articles