Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/MQZHot/ZCycleView
使用UICollectionView实现常见图片无限轮播,支持自定义cell,自定义pageControl,以及轮播样式
https://github.com/MQZHot/ZCycleView
banner infinite-scroll sdcyclescrollview swift uicollectionview uicollectionviewflowlayout
Last synced: about 2 months ago
JSON representation
使用UICollectionView实现常见图片无限轮播,支持自定义cell,自定义pageControl,以及轮播样式
- Host: GitHub
- URL: https://github.com/MQZHot/ZCycleView
- Owner: MQZHot
- License: mit
- Created: 2017-11-29T09:12:02.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-07-23T09:01:52.000Z (over 3 years ago)
- Last Synced: 2024-10-31T15:53:38.471Z (3 months ago)
- Topics: banner, infinite-scroll, sdcyclescrollview, swift, uicollectionview, uicollectionviewflowlayout
- Language: Swift
- Homepage:
- Size: 4.07 MB
- Stars: 438
- Watchers: 12
- Forks: 69
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - ZCycleView - 使用UICollectionView实现常见图片无限轮播,支持自定义cell,自定义pageControl,以及轮播样式 (iOS / CyclePagerView)
- awesome - ZCycleView - 使用UICollectionView实现常见图片无限轮播,支持自定义cell,自定义pageControl,以及轮播样式 (iOS / CyclePagerView)
README
# ZCycleView
使用`UICollectionView`实现常见图片轮播,支持自定义pageControl,自定义Cell
![](https://img.shields.io/badge/support-swift%205%2B-green.svg) ![](https://img.shields.io/badge/support-iOS%209%2B-blue.svg) ![](https://img.shields.io/cocoapods/v/ZCycleView.svg?style=flat)
## 使用方法
```swift
let cycleView = ZCycleView()
cycleView.delegate = self
cycleView.reloadItemsCount(images.count)
cycleView.itemSpacing = 10
cycleView.itemSize = CGSize(width: width - 150, height: (width - 150) / 2.3333)
cycleView.initialIndex = 1
view.addSubview(cycleView)
```#### 代理方法
```swift
protocol ZCycleViewProtocol: class {
/// 注册cell,[重用标志符:cell类]
func cycleViewRegisterCellClasses() -> [String: AnyClass]
/// 配置cell
func cycleViewConfigureCell(collectionView: UICollectionView, cellForItemAt indexPath: IndexPath, realIndex: Int) -> UICollectionViewCell
/// 开始拖拽
func cycleViewBeginDragingIndex(_ cycleView: ZCycleView, index: Int)
/// 滚动到index
func cycleViewDidScrollToIndex(_ cycleView: ZCycleView, index: Int)
/// 点击了index
func cycleViewDidSelectedIndex(_ cycleView: ZCycleView, index: Int)
/// 自定义pageControl
func cycleViewConfigurePageControl(_ cycleView: ZCycleView, pageControl: ZPageControl)
}
````