scrollview实现两条信息展示,单条信息轮播

来源:互联网 发布:nodetype js 编辑:程序博客网 时间:2024/05/16 18:23

1.主要代码

- (void)moveItem:(CGFloat)itemY{    if (itemY >= ITEM_HEIGHT * ([self.items count] -1) ) {        itemY = 0;        // 设置偏移量        [_scrollView setContentOffset:CGPointMake(0,itemY) animated:NO];        [self.scrollView setContentOffset:CGPointMake(0, ITEM_HEIGHT) animated:YES];    }        // 如果小于第一页    else if(itemY <=  0)//0    {        itemY = ITEM_HEIGHT*([self.items count]-2) ;        [_scrollView setContentOffset:CGPointMake(0,itemY) animated:NO];    }    else        [self.scrollView setContentOffset:CGPointMake(0, itemY) animated:YES];}


2.代码链接:http://download.csdn.net/download/sunnysu99/10009153

原创粉丝点击