FSCycleScrollView
示例
要运行示例项目,首先克隆仓库,然后从Example目录运行pod install
。
需求
安装
FSCycleScrollView可通过CocoaPods获得。要安装它,只需将以下行添加到Podfile中
pod 'FSCycleScrollView'
使用方法
let cycleScrollView = FSCycleScrollView(frame: CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: 200))
cycleScrollView.automaticSlidingInterval = 5 // 自动滚动间隔
cycleScrollView.hidesPageControl = false // 是否隐藏 page control
cycleScrollView.hidesPageControlForSinglePage = false // 只有一页的时候隐藏 page control
cycleScrollView.pageControlBottomOffset = 20 // page control 距底部距离
cycleScrollView.isInfinite = true // 是否无限轮播
cycleScrollView.placeholder = nil // 占位图片
cycleScrollView.dataSourceType = .onlyImage(images: []) // 只显示图片
cycleScrollView.dataSourceType = .onlyTitle(titles: []) // 只显示文本
cycleScrollView.dataSourceType = .both(items: []) // 图片加文本
作者
G-Xi0N,[email protected]
许可证
FSCycleScrollView 在MIT许可证下可用。更多信息请参阅LICENSE文件。