如何在 AutoLayout 中使用 UIScrollView (多个ContentView)
approach-multiple-smaller-views/
AutoLayout UIScrollView ScrollView 3 view ScrollView ContentView
: https://github.com/djsison/iOS-ScrollView-AutoLayout-MultipleContents view ScrollView
iOS: How to use UIScrollView with Auto Layout (PureAuto Layout) – Single Content View
AutoLayout https://developer.apple.com/library/ios/technotes/tn2154/_index.html
View (UIViewController view)
-
· Scroll View (UIScrollView)–
-
· Container View (UIView) –
-
· Content1 (UIView) –
-
· Content2 (UIView) –
-
· Content3 (UIView) – :
Scroll view
Scroll View Scroll View contentSize
Scroll View Content1Content2Content3
Container View topbottomleft right
content view
Scroll View Scroll View Scroll View ed with exit code 1
ScrollView topleftrightbottom ScrollView
Scroll View ContentSize
Container View (UIView): Scroll Viewleading, trailing, top, bottom 0
leading, trailing, top, bottom 0Container View 3 Content views
ScrollView ScrollView
Content1: 100 240leading trailing 20top 8bottom 8 Content1
Content2
leading trailing width content1 view Xcode content1 bottom topleftright ScrollView Content2: leading trailing 20 , bottom 8 (Content2 Content3 ), 100 content1 ScrollView contentSize
Content3: leading trailing 20button 20content3 superView ContainerView 100 view ScrollView
contentView ScrollView contentView Size Content1 [super viewDidLoad]; self.content1WidthConstraint.constant = 500;
IBOulet.
尝试修改content2的高度
[super viewDidLoad]; self.content2HeightConstraint.constant = 200;
}