And every time you want to use it, sometimes you choose to use tableView to solve this problem; So uiscrollView is rarely used, in fact, the correct use of uiscrollView is very good; I’ve tried to add uiscrollView to my storyboard more than three times, but I’ve rewritten it every time, and I’ve published it, but I’m going to rewrite it today, hopefully this will be the last one…

  • And every time you want to use it, sometimes you choose to use tableView to solve this problem
  • So uiscrollView is rarely used, in fact, the correct use of uiscrollView is also very good
  • I’ve tried to add uiscrollView to my storyboard more than three times every time I’ve used it, and I’ve rewritten it every time, and I’ve published it, but I’m going to rewrite it again today, hopefully this will be the last one

Perception: knowledge collection, not only their own may forget, and certainly no contribution to others

Why do I get so many errors when I add scrollViews to my XIB or storyboard

  • Because UIScrollView can slide only if it knows its ContentSize, we just add the constraint to it, it doesn’t know what its ContentSize is, so it gets an error

Quote: Since Apple came out with Auto Layout, after being open person, deeply experienced his convenient place, no longer to fit different screen Layout and worrying about U, we just need to be associated with such a xib file, to the place we need to control xib, and play its relative to the parent view and view of the constraint relations, at the same level so that we will ready the adaptation of different screen. Add child control to UIScrollView, same operation as before, but the error is very terrible, why is that?

UIScrollView can slide only if it knows its ContentSizel size. We add constraint to it directly. It does not know its ContentSizel size

Note: From Xcode 11, scroll View default check Content Layout Guides, So at the bottom of the Scroll view is going to be a Content Layout Guide and a Frame Layout Guide.


Reference solution (I also own a video recording, prevent to check this problem next time) link: pan.baidu.com/s/1KAH5sGu1… Password: vml3

  • 1. Drag and drop the scrollView

  • 2. Add a four-week limit for scrollView

  • 3. Drag and drop a View to add to the ScrollView

  • 4. Added a perimeter limit to the view

  • 5. Diszontally contains assed assed in vertical scrolling

  • 6. Scroll vertically to add view fixed height and pull out properties (ven: the height here is the height of your content, if it is not high enough to pull out properties)/scroll horizontally to add view fixed width and pull out properties

  • 7. At this time, the red burst disappears