scrollview has ambiguous scrollable content height & Width
11,391
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.
![veerendra pratap singh](https://i.stack.imgur.com/j9HTf.png?s=256&g=1)
Author by
veerendra pratap singh
Updated on June 05, 2022Comments
-
veerendra pratap singh about 2 years
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
-
veerendra pratap singh over 6 years@zemoon how you show image through url
-
ZeMoon over 6 yearsYou should be able to do so after 10 reputation.
-
Sagar Chauhan over 6 yearsPlease show Storyboard ViewController image. So People can give you more precise solution. Also one more thing, you have added Page Control Inside Scroll View, but there are also need to add content View and then add page control.
-
Amit over 6 years
-
-
veerendra pratap singh over 6 yearsI have done this but its showing me again same error
-
LGP over 6 yearsAre you sure you tied all edges and set the height and width? Did you also have only one view inside your scroll view? Was the error from this scroll view, as you seem to have several scroll views in your design.
-
Andrew Duncan over 5 yearsThis worked for me, and in fact is the solution implemented by Xcode when you ask it to add constraints to fix the "problem".