First, Uiscrollview (1). Common Properties @property (nonatomic) Cgpoint contentoffset; //record the location of Uiscrollview scrolling@property (nonatomic) cgsize contentsize;//content size (range that can be scrolled)@property (nonatomic,assign)ID<UIScrollViewDelegate>Delegate;//Proxy Object@property (nonatomic) BOOL bounces;//does it have a spring effect ?@property (nonatomic) BOOL showshorizontalscrollindicator;//whether to display the horizontal scroll bar@property (nonatomic) BOOL showsverticalscrollindicator;//whether to show vertical scroll bars//Tip: Finish mastering contentsize, Contentoffset, delegate(2). Pinch gesture Zoom1. Scaling principle Detailed1>when the user attempts to scale Uiscrollview, ScrollView tries to send a message to its delegate (proxy object) asking which child control to indent2>In other words, ScrollView 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 scaled2Summary of Scaling principles1>Uiscrollview Set Delegate object first2>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 control that needs to be scaled3>Uiscrollview to negotiate with the delegate object: Which method returns the child controls that need to be scaled?4>the way to return the child controls that need to be scaled is:-(UIView *) Viewforzoominginscrollview:3. Half of the scaling implementation steps (such as scaling Uiscrollview internal Uiimageview)1>set ScrollView's delegate to Controller (self)2> Controller complies with Uiscrollviewdelegate protocol <UIScrollViewDelegate>3> Controller implementation. (UIView *) Viewforzoominginscrollview: Method that returns the child controls that need to be scaled4>set maximum and minimum scaling two, agent design mode1, use occasions1>a want B to help do some things, let B become a agent2>a want to inform B something happened, or want to pass some data to B, let B become a agent3>B want to listen to some of the things a do, let B become a agent2, use steps1>Define an agreement2>B to comply with the agreement, to achieve the appropriate method3To define a proxy attribute in >aID< agreements >Delegate; 4> Create a B object, set the delegate property of A to B object
Xcode--uiscrollview and Agent Mode