[Basic iOS control and basic ios Control

Source: Internet
Author: User

[Basic iOS control and basic ios Control
Source image: 900x1305 1 // 2 // ViewController. m 3 // ImageZoom 4 // 5 // Created by hellovoidworld on 14/11/28. 6 // Copyright (c) 2014 hellovoidworld. all rights reserved. 7 // 8 9 # import "ViewController. h "10 11 @ interface ViewController () 12 13 // picture control 14 @ property (weak, nonatomic) IBOutlet UIImageView * imageView; 15 16 // UIScrollView control 17 @ property (weak, nonatomic) IBOutlet UIScrollView * scrollView; 18 19 @ end20 21 @ implementation ViewController22 23-(void) viewDidLoad {24 [super viewDidLoad]; 25 // Do any additional setup after loading the view, typically from a nib.26 27 self. scrollView. contentSize = CGSizeMake (900,130 5); 28 self. scrollView. delegate = self; 29 30 self. scrollView. maximumZoomScale = 2.0; 31 self. scrollView. minimumZoomScale = 0.1; 32 33} 34 35-(void) didReceiveMemoryWarning {36 [super didreceivemorywarning]; 37 // Dispose of any resources that can be recreated.38} 39 40 41-(void) scrollViewWillBeginDragging :( UIScrollView *) scrollView {42 NSLog (@ "start dragging"); 43} 44 45-(void) scrollViewDidScroll :( UIScrollView *) scrollView {46 NSLog (@ "dragging"); 47} 48 49-(void) scrollViewDidEndDragging :( UIScrollView *) scrollView willDecelerate :( BOOL) decelerate {50 NSLog (@ "End drag"); 51} 52 53 54 // scaling gesture call Method 55-(UIView *) viewForZoomingInScrollView :( UIScrollView *) scrollView {56 return self. imageView; // ImageView57} 58 59-(void) scrollViewWillBeginZooming: (UIScrollView *) scrollView withView :( UIView *) view {60 NSLog (@ "start scaling "); 61} 62 63-(void) scrollViewDidZoom :( UIScrollView *) scrollView {64 NSLog (@ "Scaling"); 65} 66 67-(void) scrollViewDidEndZooming :( UIScrollView *) scrollView withView :( UIView *) view atScale :( CGFloat) scale {68 NSLog (@ "End scaling"); 69} 70 71-(void) scrollViewWillBeginDecelerating :( UIScrollView *) scrollView {72 NSLog (@ "deceleration starts after dragging"); 73} 74 75-(void) scrollViewDidEndDecelerating :( UIScrollView *) scrollView {76 NSLog (@ "slowing down after dragging"); 77} 78 79 @ end80

 

Related Article

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.