? ? first, the knowledge point simple introduction
What is a 1.UIScrollView control?
(1) The screen of the mobile device? Small is extremely limited, so direct exhibition, the content of the user's eyes is also very limited
(2) When the exhibition shows more content than a screen, the user can scroll through gestures to see what's outside of the screen
(3) Ordinary UIView does not have scrolling function, can not display too much content
(4) Uiscrollview is a scrollable view control that can be used to show a lot of content, and can scroll to see all the content
(5) Example: "Settings" on the phone, other? sample programs ? ?
Simple use of 2.UIScrollView
(1) Add the content that needs to show to Uiscrollview
(2) Set the Contentsize property of the Uiscrollview, tell Uiscrollview all the contents of the ruler, that is, to tell it the range of scrolling (how far to roll, where to roll to the end)
3. Properties
(1) Common properties:
1) @property (nonatomic) Cgpointcontentoffset; This property is used to display uiscrollview scrolling position
2) @property (nonatomic) cgsizecontentsize; This property is used to uiscrollview The contents of the table, scroll range (how far to roll)
3) @property (nonatomic) Uiedgeinsetscontentinset; This property is capable of adding additional scrolling areas for 4 weeks of Uiscrollview
(2) Other properties:
1) @property (nonatomic) BOOL bounces; Set Uiscrollview If spring effect is required
2) @property (nonatomic,getter=isscrollenabled) boolscrollenabled; Sets whether Uiscrollview can scroll
3) @property (nonatomic) BOOL showshorizontalscrollindicator; Do you have a display? Horizontal scroll bar
4) @property (nonatomic) BOOL showsverticalscrollindicator; Do you want to show the vertical scroll bar?
4. Attention points
? If Uiscrollview cannot scroll, the following may be the reason:
(1) No setup contentsize
(2) scrollenabled = NO
(3) No Touch event Received: userinteractionenabled = no
(4) No cancellation of AutoLayout function (if you want to scrollview scrolling, you must cancel AutoLayout)
IOS ScrollView Knowledge points