One, Common Properties
@property (nonatomic) cgpoint contentoffset; //record uiscrollview scrolling position
@property (nonatomic) cgsize contentsize; //content size ( The range that can be scrolled)
@property (nonatomic) uiedgeinsets contentinset; //Additional scrolling area (4 edges up or down)
@property (nonatomic, assign) id< Uiscrollviewdelegate> delegate;
@property (nonatomic) BOOL bounces; //have spring effect
@property (Nonatomi c) BOOL showshorizontalscrollindicator; //whether to display the horizontal scrollbar
@property (nonatomic) bool Showsverticalscrollindicator ; whether to display the vertical scroll bar
Focus on mastering Contentsize, Contentoffset, delegate
Second, pinch gesture zoom
1. Detailed Scaling principle
1> when the user attempts to scale the Uiscrollview, Uiscrollview tries to send a message to his delegate (proxy object) asking which child control to scale.
2> in other words, that is, Uiscrollview tries to call a method of delegate, asking which child control to scale, and the return value of the method is the child control that needs to be scaled.
2. Summary of Scaling principle
1> Uiscrollview Set Delegate object first
2> Uiscrollview must know which method delegate returns the child controls that need to be scaled, and delegate must implement the method that returns the child controls that need to be scaled.
3> Uiscrollview to negotiate with delegate object: Which method returns the child controls that need to be scaled?
4> the method that returns a child control that needs to be scaled is:
-(UIView *) Viewforzoominginscrollview: (Uiscrollview *) ScrollView;
3. General implementation steps for scaling (such as scaling Uiscrollview internal Uiimageview)
1> setting the delegate of the Uiscrollview as the Controller (self)
2> Controller complies with Uiscrollviewdelegate protocol <UIScrollViewDelegate>
3> Controller Implementation-(UIView *) Viewforzoominginscrollview: Method, returns the child controls that need to be scaled
4> setting the maximum and minimum zoom ratios
iOS Common Controls-uiscrollview