可实现自动循环轮播 slider 效果
源码和使用 demo 都在这里: https://github.com/liaojinxing/LJAutoScrollView
欢迎使用,如有问题也请不吝赐教。
LJAutoScrollView class provides an endlessly circulate scroll view. It allows auto scrolling infinitely in the horizontal direction.
It offers an encapsulation of UICollectionView to support reuse features.
Use NSTimer for auto scrolling.
The implement of infinite scroll is inspired by this page:Circular Infinite UIScrollView
Compared to other implmentation, LJAutoScrollView is more stable and easier to use:
- Some implementation like GBInfiniteScrollView is subclass from UIScrollView, while LJAutoScrollView uses UICollectionView, it's more stable on reuse feature and gesture recognization.
LJAutoScrollView integrates UIPageControl as well. You need not to handle the page change yourself.
The infinite circulate scroll feature implementation is more elegant and robust than SDCycleScrollView.
It's easier to use. The usage is described below.
Grab the source file into your project.
Or use cocoapods. Here is an example of your podfile:
pod 'LJAutoScrollView'
self.autoScrollView = [[LJAutoScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, kAutoScrollViewHeight)];
self.autoScrollView.delegate = self;
self.autoScrollView.itemSize = CGSizeMake(self.view.frame.size.width, kAutoScrollViewHeight);
self.autoScrollView.scrollInterval = 3.0f;
Check the demo project for more details.
1
Ixizi 2015-10-18 16:19:22 +08:00
看不懂,你就不能上个 GIF 图片吗
|
2
strom001 2015-10-19 20:36:39 +08:00
点开就有了啊
|