- Add ScrollView and its child views
- Parent view. Addsubview (ScrollView)
- Scrollview.addsubview (Container)--container is a placeholder view
- Container.addsubviews (true · Want to show the views)
- Pull (or masturbate) constraints
- ScrollView. Four sides stick to the parent view. Four edges
- Container. Four-sided adhesion ScrollView.
- Container.width = Scrollview.width (if you want to implement horizontal scrolling, it is Container.height = scrollview.height)
- Container.subviews (Really want to show the views) to enjoy the layout, just remember a little,
拉(或撸)出来的约束要能确定出container的高度(横向滚动则为宽度)
.
The most straightforward layout is the same as in my demo: "v:|-[imageview]-[label]-[label]--[contentview]-[label]-|", sticking one from top to bottom, so that the height can be counted.
Excerpt from: http://www.jianshu.com/p/15277e17f127
ios--basic knowledge--autolayout and ScrollView