bestDew /
ZKCycleScrollViewDemo
A simple and useful automatic infinite scroll view, more elegant implementation and more friendly API. Support Objective-C and Swift. 一款简单实用的轮播图控件,更优雅的实现,更友好的API。支持 Objective-C 和 Swift。
28/100 healthLoading repository data…
bestDew / repository
A simple and useful automatic infinite scroll view, more elegant implementation and more friendly API. Support Objective-C and Swift. 一款简单实用的轮播图控件,更优雅的实现,更友好的API。支持 Objective-C 和 Swift。
A transparent discovery signal based on current public GitHub metadata.
This score does not audit code, security, maintainers, documentation quality, or suitability. Verify the repository and its current documentation before adoption.
ZKCycleScrollView是的一个功能强大的轮播视图。支持 Objective-C 和 Swift。
pod install才能运行。pod 'ZKCycleScrollView'
@interface ViewController () <ZKCycleScrollViewDelegate, ZKCycleScrollViewDataSource>
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
ZKCycleScrollView *cycleScrollView = [[ZKCycleScrollView alloc] initWithFrame:CGRectMake(0.f, 0.f, 375.f, 65.f)];
cycleScrollView.delegate = self;
cycleScrollView.dataSource = self;
[cycleScrollView registerCellClass:[CustomCell class] forCellWithReuseIdentifier:@"cellReuseId"];
[self.view addSubview:cycleScrollView];
}
#pragma mark -- ZKCycleScrollView DataSource
- (NSInteger)numberOfItemsInCycleScrollView:(ZKCycleScrollView *)cycleScrollView {
return 5;
}
- (__kindof ZKCycleScrollViewCell *)cycleScrollView:(ZKCycleScrollView *)cycleScrollView cellForItemAtIndex:(NSInteger)index {
CustomCell *cell = [cycleScrollView dequeueReusableCellWithReuseIdentifier:@"cellReuseId" forIndex:index];
// TODO:
return cell;
}
#pragma mark -- ZKCycleScrollView Delegate
- (void)cycleScrollView:(ZKCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index {
// TODO:
}
@end
1.支持 CocoaPods 导入:
pod 'ZKCycleScrollView'
2.支持取消无限轮播:
// 通过Xib 方式创建的,可直接在属性面板中直接设置 infiniteLoop 为 off
// 通过纯代码方式创建的,需要使用下面这种初始化方法并设置 infiniteLoop 参数为 NO
- (instancetype)initWithFrame:(CGRect)frame shouldInfiniteLoop:(BOOL)infiniteLoop NS_DESIGNATED_INITIALIZER;
3.支持设置默认显示页:
// 设置默认从第三页开始显示
__weak typeof(self) weakSelf = self;
_cycleScrollView.loadCompletion = ^{
__strong typeof(weakSelf) strongSelf = weakSelf;
[strongSelf.cycleScrollView scrollToIndex:3 animated:NO];
};
4.修复界面跳转时 cell 自动偏移的 bug;
5.修复在加载时就回调代理方法的 bug;
6.移除 -adjustWhenViewWillAppear 方法;
7.新增 -beginUpdates、-endUpdates、-scrollToIndex:animated:、-cellForItemAtIndex: 等方法,具体使用见Demo;
8.优化性能。
Selected from shared topics, language and repository description—not editorial ratings.
bestDew /
A simple and useful automatic infinite scroll view, more elegant implementation and more friendly API. Support Objective-C and Swift. 一款简单实用的轮播图控件,更优雅的实现,更友好的API。支持 Objective-C 和 Swift。
28/100 health