`
zheyiw
  • 浏览: 997227 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

UIScrollView 自动滚动相册

阅读更多

假如你用UIScrollView制作了一个横向的相册,并且每页显示一张图,有点想很多网站首页的广告

//广告定时任务
[NSTimer scheduledTimerWithTimeInterval:2 target:self selector:@selector(scrollTimer) userInfo:nil repeats:YES];


//设置滚动
-(void)scrollTimer{    
    timerCount++;
    if (timerCount >= 4) {
        timerCount=0;
    }
    [adView setContentOffset:CGPointMake(tableWidth * timerCount, 0)animated:YES];
    [pageControl setCurrentPage:timerCount];
}
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics