Search code examples
iosswiftheightwidthscrollview

scrollview has ambiguous scrollable content height & Width


How Can i solve it. I try all type of constraints like top, bottom, left , right, horizontally, vertically, also equal height and width plz see the link below for image


Solution

  • Scroll views are special when you set constraints. Because they have an undefined content size you must set constraints for both its contents' sizes and edges. Setting only top, bottom, left, right is not enough, also set height and width.

    Try this. Add a single UIView to an otherwise empty scroll view. Then tie the edges of the view to the scroll view. Finally set the height and width to fixed size.

    Read more