Search code examples
uiscrollviewautolayout

UIScrollView has ambiguous scrollable content but it has no content


Why does this scroll view have ambiguous scrollable content, when it doesn't have any content?

enter image description here


Solution

  • Presumably, you are laying this out with the intention of adding subviews (with proper constraints) to the scroll view at run-time.

    But, Storyboard / Interface Builder has no idea what your code is going to do in the future.

    You can either leave it as is and ignore the warning,

    or

    Tell Storyboard to stop warning you about it by selecting the scroll view and then selecting Ambiguity: Never Verify in the size inspector pane:

    enter image description here

    or

    Add some content, such as a UIView that you will use to hold the UI elements you plan to add at run-time.