Skip to content

Rain-dew/YLDragZoomCycleView

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

YLDragZoomCycleViewDemo

一个可以下拉放大的轮播图

如何使用?

   //创建轮播图
   self.dragView = [[YLDragZoomCycleView alloc] initWithFrame:CGRectMake(0, 0, self.view.yl_width, kHeaderHeight) andAutoScroll:YES scrollInterval:2];
    self.dragView.delegate = self;
    self.dragView.dataSource = [self getimageSource];
    [self.tableView addSubview:self.dragView];
    

同时你必须实现滚动试图的代理方法,并且调用几个函数。格式如下

- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
    //告诉dragView表格滑动了
    CGFloat offset = scrollView.contentOffset.y + kHeaderHeight;
    [self.dragView dragViewWithOffset:offset];
    
}
//正在拖拽的时候停止自动滚动
- (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView {
    [self.dragView stopScroll];
}
//停止滑动开启自动滚动
- (void)scrollViewDidEndDragging:(UIScrollView *)scrollView willDecelerate:(BOOL)decelerate {
    [self.dragView startScroll];
}

效果图

image

About

一个可以下拉放大的轮播图

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published