DVViewPager 可通过 CocoaPods 使用。要安装它,只需将以下行添加到您的 Podfile 中
pod 'DVViewPager'
let width = UIScreen.main.bounds.width
let height = width * 9 / 16
let infiniteScrollView = InfiniteScrollView(frame: CGRect(x: 0, y: 0, width: width, height: height), collectionViewLayout: UICollectionViewFlowLayout())
infiniteScrollView.backgroundColor = .green
infiniteScrollView.setData(myList)
view.addSubview(infiniteScrollView)
width
属性必须是屏幕宽度
DVViewPager 在 MIT 许可证下可用。有关更多信息,请参阅 LICENSE 文件。