zoukankan      html  css  js  c++  java
  • UIScrollView

    - (void)viewDidLoad

    {

        [super viewDidLoad];

        scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(0, 0, 320, 460)];

        scrollView.backgroundColor = [UIColor redColor];

        // 是否支持滑动最顶端

        //    scrollView.scrollsToTop = NO;

        scrollView.delegate = self;

        // 设置内容大小

        scrollView.contentSize = CGSizeMake(320, 460*10);

        // 是否反弹

         //    scrollView.bounces = NO;

        // 是否分页

        //    scrollView.pagingEnabled = YES;

        // 是否滚动

        //    scrollView.scrollEnabled = NO;

        //    scrollView.showsHorizontalScrollIndicator = NO;

        // 设置indicator风格

        //    scrollView.indicatorStyle = UIScrollViewIndicatorStyleWhite;

        // 设置内容的边缘和Indicators边缘

        //    scrollView.contentInset = UIEdgeInsetsMake(0, 50, 50, 0);

        //    scrollView.scrollIndicatorInsets = UIEdgeInsetsMake(0, 50, 0, 0);

        // 提示用户,Indicators flash

        [scrollView flashScrollIndicators];

        // 是否同时运动,lock

        scrollView.directionalLockEnabled = YES;

        [self.view addSubview:scrollView];

         

        UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 200, 320, 40)];

        label.backgroundColor = [UIColor yellowColor];

        label.text = @"学习";

        [scrollView addSubview:label];

        [label release];

    }

        // 返回一个放大或者缩小的视图

    - (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView

    {

    }

        // 开始放大或者缩小

    - (void)scrollViewWillBeginZooming:(UIScrollView *)scrollView withView:

    (UIView *)view

    {

         

    }

        // 缩放结束时

    - (void)scrollViewDidEndZooming:(UIScrollView *)scrollView withView:(UIView *)view atScale:(float)scale

    {

         

    }

        // 视图已经放大或缩小

    - (void)scrollViewDidZoom:(UIScrollView *)scrollView

    {

    NSLog(@"scrollViewDidScrollToTop");

    }

      // 是否支持滑动至顶部

    - (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView

    {

        return YES;

    }

         // 滑动到顶部时调用该方法

    - (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView

    {

    }

      // scrollView 已经滑动

    - (void)scrollViewDidScroll:(UIScrollView *)scrollView

    {

    }

      // scrollView 开始拖动

    - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView

    {

        NSLog(@"scrollViewWillBeginDragging");

    }

     // scrollView 结束拖动

    - (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate

    {

    }

       // scrollView 开始减速(以下两个方法注意与以上两个方法加以区别)

    - (void)scrollViewWillBeginDecelerating:(UIScrollView *)scrollView

    {

    }

       // scrollview 减速停止

    - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView

    {

    }

  • 相关阅读:
    java删除文件夹及子目录
    SQL语法精讲(包括建库、建表、建视图、查询、增加、删除、)
    图片压缩工具类
    数据库中的java.sql.Timestamp转换成Date
    mysql数据库连接工具类C3P0
    java发送邮件带附件
    java下载文件
    web程序定时器
    数据库之函数、数据类型转换(转)
    数据库基础(变量、运算符、if语句、while语句)
  • 原文地址:https://www.cnblogs.com/ljcgood66/p/5396681.html
Copyright © 2011-2022 走看看