3 Star 0 Fork 0

Gitee 极速下载 / ZQEndlessPageControl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/zeqinjie/ZQEndlessPageControl
克隆/下载
README.md 3.41 KB
一键复制 编辑 原始数据 按行查看 历史
zhengzeqin 提交于 2022-08-25 10:45 . 修改个人邮箱

ZQEndlessPageControl

CI Status Version License Platform

功能

自定义 iOS14 PageControl 控件新功能 ☑️

  • 最大展示个数 ☑️
  • 设置大小、间隙、背景颜色 ☑️
  • 设置边框大小,颜色 ☑️
  • 设置大、中、小,三种状态的缩放系数 ☑️
  • 设置背景图 ☑️

效果

使用

配置对象

public struct ZQEndlessPageControlConfiguration {
    /// 总共点个数
    var numberOfDots: Int
    /// 支持最大展示多少个点
    var maxNumberOfDots: ZQEndlessPageControlMaxNumberOfDots
    /// 选择点的颜色
    var selectedDotColor: UIColor
    /// 未选择点的颜色
    var unselectedDotColor: UIColor
    /// 点大小
    var dotSize: CGFloat
    /// 点间隙
    var spacing: CGFloat
    /// 未选中的缩放系数
    var mediumScale: CGFloat
    /// 选中的缩放系数
    var selectedScale: CGFloat
    /// 最小的点的缩放系数
    var smallScale: CGFloat
    /// 点边框色
    var dotBorderColor: UIColor?
    /* 📢注意当设置了 selectedIndicatorImage & unselectedIndicatorImage 时候,不展示默认的圆点*/
    /// 当前选中展示图片
    var selectedIndicatorImage: UIImage?
    /// 当前未选中展示图片
    var unselectedIndicatorImage: UIImage?
}

DEMO

import ZQEndlessPageControl

fileprivate let indicatorPageControl1: ZQEndlessPageControlIndicator = ZQEndlessPageControlIndicator()
self.view.addSubview(indicatorPageControl1)
indicatorPageControl1.snp.makeConstraints { (make) in
    make.center.equalToSuperview()
}
    
let indicatorConfigure = ZQEndlessPageControlConfiguration(
    numberOfDots: Metric.indicatorPageDotNum,
    dotSize: 8,
    dotBorderColor: UIColor.black.withAlphaComponent(0.19)
)
indicatorPageControl1.setup(configuration: indicatorConfigure)

// 设置指示图的图标
if #available(iOS 13.0, *) {
    self.view.addSubview(indicatorPageControl3)
    indicatorPageControl3.snp.makeConstraints { (make) in
        make.centerX.equalToSuperview()
        make.top.equalTo(self.indicatorPageControl2.snp.bottom).offset(10)
    }
    
    
    let indicatorConfigure = ZQEndlessPageControlConfiguration(
        numberOfDots: Metric.indicatorPageDotNum,
        maxNumberOfDots: .seven,
        dotSize: 20,
        selectedIndicatorImage: UIImage(systemName: "sun.max.fill"),
        unselectedIndicatorImage: UIImage(systemName: "moon.fill")
    )
    
   indicatorPageControl3.setup(configuration: indicatorConfigure)
}

安装

ZQEndlessPageControl is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'ZQEndlessPageControl'

Author

zhengzeqin, zeqinjie@qq.com

License

ZQEndlessPageControl is available under the MIT license. See the LICENSE file for more info.

Swift
1
https://gitee.com/mirrors/ZQEndlessPageControl.git
git@gitee.com:mirrors/ZQEndlessPageControl.git
mirrors
ZQEndlessPageControl
ZQEndlessPageControl
master

搜索帮助