Gitee — Enterprise-level DevOps R&D management platform
Join Gitee
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/zeqinjie/ZQEndlessPageControl
Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

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, zhengzeqin@addcn.com

Release Notes

  • v0.1.0: demo 展示
  • v0.2.0: 设置背景图 ☑️

License

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

Repository Comments ( 0 )

Sign in for post a comment

About

为了适配 iOS14 的 pageControl 自定义的控件 效果演示: expand collapse
Swift and 2 more languages
MIT
Cancel

Releases

No release

Contributors

All

Activities

load more
can not load any more