[iOS base Control-5.2] View large image, zoom image code (Uiscrollview)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.