UIScrollView (1) Basic UIScrollView usage and proxy method, uiscrollview proxy

Source: Internet
Author: User

UIScrollView (1) Basic UIScrollView usage and proxy method, uiscrollview proxy
- (void)viewDidLoad{    [super viewDidLoad];         scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];    scrollView.backgroundColor = [UIColor redColor];    // Whether sliding to the top is supported//    scrollView.scrollsToTop = NO;    scrollView.delegate = self;    // Set the content size    scrollView.contentSize = CGSizeMake(320, 460*10);    // Whether to rebound//    scrollView.bounces = NO;    // Whether the page is displayed//    scrollView.pagingEnabled = YES;    // Whether to scroll//    scrollView.scrollEnabled = NO;//    scrollView.showsHorizontalScrollIndicator = NO;    // Set the indicator Style//    scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;    // Set the content edge and Indicators edge//    scrollView.contentInset = UIEdgeInsetsMake(0, 50, 50, 0);//    scrollView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 50, 0, 0);    // Prompt the user, Indicators flash    [scrollView flashScrollIndicators];    // Whether or not the movement is at the same time, lock    scrollView.directionalLockEnabled = YES;    [self.view addSubview:scrollView];         UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 200, 320, 40)];    label.backgroundColor = [UIColor yellowColor];    label.text = @"Learn scrolleview";    [scrollView addSubview:label];    [label release];} #pragma mark - /*// Return a magnified or zoomed-out view- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView{     }// Start to zoom in or out- (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:(UIView *)view{     } // End of Scaling- (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale{     }  // The view has been zoomed in or out.- (void)scrollViewDidZoom:(UIScrollView *)scrollView{NSLog(@"scrollViewDidScrollToTop");} */ // Whether sliding to the top is supported- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView{    return YES;} // Call this method when sliding to the top- (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView{    NSLog(@"scrollViewDidScrollToTop");} // ScrollView slides- (void)scrollViewDidScroll:(UIScrollView *)scrollView{    NSLog(@"scrollViewDidScroll");} // Start dragging scrollView- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView{    NSLog(@"scrollViewWillBeginDragging");} // Drag the scrollView to the end- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate{    NSLog(@"scrollViewDidEndDragging");} // ScrollView starts to slow down (the following two methods must be different from the above two methods)- (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView{    NSLog(@"scrollViewWillBeginDecelerating");} // Scrollview stop- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView{   NSLog(@"scrollViewDidEndDecelerating"); }

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.