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.
Scrolling only happens when the content view inside the scrollview is larger than the scrollview! To elaborate on point 6. If the stack view had no elements but all the constraints are in place, you get "Scroll View Need constraints for Y position or height".
We will use “Content Layout Guide” to give this info to UIScrollView since “Content Layout Guide” relates to the size of the scrollable content area inside UIScrollView. Pin UITextView into “Content Layout Guide” edges with constant value “0” for each constraints: UITextView pinned to Content Layout Guide.
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:
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