Original: X 1305 drag and scroll: Zoom: Main code:
1 //2 //VIEWCONTROLLER.M3 //Imagezoom4 //5 //Created by Hellovoidworld on 14/11/28.6 //Copyright (c) 2014 Hellovoidworld. All rights reserved.7 //8 9 #import "ViewController.h"Ten One @interfaceViewcontroller () A - //Picture Controls -@property (Weak, nonatomic) Iboutlet Uiimageview *ImageView; the - //Uiscrollview Controls -@property (Weak, nonatomic) Iboutlet Uiscrollview *ScrollView; - + @end - + @implementationViewcontroller A at- (void) Viewdidload { - [Super Viewdidload]; - //additional setup after loading the view, typically from a nib. - -Self.scrollView.contentSize = Cgsizemake ( the,1305); -Self.scrollview.Delegate=Self ; in -Self.scrollView.maximumZoomScale =2.0; toSelf.scrollView.minimumZoomScale =0.1; + - } the *- (void) didreceivememorywarning { $ [Super didreceivememorywarning];Panax Notoginseng //Dispose of any resources the can be recreated. - } the + A- (void) Scrollviewwillbegindragging: (Uiscrollview *) ScrollView { theNSLog (@"Start dragging"); + } - $- (void) Scrollviewdidscroll: (Uiscrollview *) ScrollView { $NSLog (@"being dragged"); - } - the- (void) Scrollviewdidenddragging: (Uiscrollview *) ScrollView willdecelerate: (BOOL) decelerate { -NSLog (@"End Drag");Wuyi } the - Wu //methods for scaling gesture calls --(UIView *) Viewforzoominginscrollview: (Uiscrollview *) ScrollView { About returnSelf.imageview;//need to enlarge the ImageView $ } - -- (void) Scrollviewwillbeginzooming: (Uiscrollview *) ScrollView Withview: (UIView *) View { -NSLog (@"Start Scaling"); A } + the- (void) Scrollviewdidzoom: (Uiscrollview *) ScrollView { -NSLog (@"Scaling in Progress"); $ } the the- (void) Scrollviewdidendzooming: (Uiscrollview *) ScrollView Withview: (UIView *) View Atscale: (cgfloat) Scale { theNSLog (@"End Zoom"); the } - in- (void) Scrollviewwillbegindecelerating: (Uiscrollview *) ScrollView { theNSLog (@"slow start when towing is complete"); the } About the- (void) Scrollviewdidenddecelerating: (Uiscrollview *) ScrollView { theNSLog (@"deceleration complete after towing complete"); the } + - @end the
[iOS base Control-5.2] View large image, zoom image code (Uiscrollview)