ZB-3D-CycleScrollViewDemo

- 手动导入:将ZB(3D)CycleScrollView文件夹拖入工程后声明ZB_3D_CycleScrollView.h头文件即可
- pods导入:
pod 'ZB_3D_CycleScrollView', '~> 0.0.6'
- (ZB_3D_CycleScrollView *)cycleScrollView{
if (!_cycleScrollView) {
_cycleScrollView = [[ZB_3D_CycleScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.bounds.size.width, 200)];
//设置网络图片数组
_cycleScrollView.urlImageNames = self.urlImageNames;
//设置本地图片数组
//_cycleScrollView.localImageNames = self.localImageNames;
//设置标题数组
_cycleScrollView.titles = self.titles;
//设置标题填充样式
_cycleScrollView.titleLabelAlignment = NSTextAlignmentCenter;
//设置标题字体
_cycleScrollView.titleLabelFont = [UIFont boldSystemFontOfSize:20];
//设置轮播方向:Right,Left,Top,Bottom
_cycleScrollView.dirction = DirectionLeft;
//设置占位图片(传UIImage对象)
_cycleScrollView.placeholderImage = [UIImage imageNamed:@"placeholderImage"];
//轮播间隔时间:必须大于默认动画时间
_cycleScrollView.timeInterval = 3;
//默认动画时间
_cycleScrollView.animationTimeWhenDefault = 0.5f;
//拖动时的动画时间
_cycleScrollView.animationTimeWhenGrag = 0.3f;
//设置UIPageControl当前页的颜色
_cycleScrollView.currentPageIndicatorTintColor = [UIColor redColor];
//设置其他页的颜色
_cycleScrollView.pageIndicatorTintColor = [UIColor cyanColor];
//设置代理
_cycleScrollView.delegate = self;
}
return _cycleScrollView;
}
//点击触发代理方法
- (void)cycleScrollView:(ZB_3D_CycleScrollView *)cycleScrollView DidSelectItem:(NSInteger)indexPathItem{
NSLog(@"点击%@-tag:%ld的第%ld张图片",NSStringFromClass([cycleScrollView class]),cycleScrollView.tag, indexPathItem);
}
- 在使用过程中可能会遇到滑动手势与其他控件的手势发生冲突的问题,因此提供了一个解决手势冲突的方法:
/**
将轮播图拖动手势设置为较高优先级
@param gesture 与轮播图拖动手势相冲突的手势
*/
-(void)setLowPriorityWithGesture:(UIGestureRecognizer *)gesture;
谢谢支持,可能还有很多不完善的地方,期待您的建议!如对您有帮助,请不吝您的Star,您的支持与鼓励是我继续前行的动力。
邮箱:zhengbo073017@163.com