• 循环轮转,


    -(void)scrollByTimer

    {

        CGPoint oldoffset = cellScrollView.contentOffset;

        CGPoint newOffset = CGPointMake(cellScrollView.contentOffset.x+320, cellScrollView.contentOffset.y);

        if (oldoffset.x >= 320*(cellData.count-1)) {

            CGPoint beginPoint = CGPointMake(0, cellScrollView.contentOffset.y);

            [cellScrollView setContentOffset:beginPoint animated:YES];

        }else{

            [cellScrollView setContentOffset:newOffset animated:YES];

        }

    }

     

    -(void)scheduleTimer

    {

        [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(scrollByTimer) userInfo:Nil repeats:YES];

    }

  • 相关阅读:
    常用命令
    经典算法
    框架
    计算机网络
    设计模式
    JVM
    数据库
    多线程
    Java中HashMap的底层实现原理
    构建大小顶堆
  • 原文地址:https://www.cnblogs.com/guligei/p/3924074.html
Copyright © 2020-2023  润新知