3 Star 0 Fork 0

Gitee 极速下载 / ZQEndlessPageControl

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/zeqinjie/ZQEndlessPageControl
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

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.

Copyright (c) 2021 zhengzeqin <zeqinjie@qq.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

为了适配 iOS14 的 pageControl 自定义的控件 效果演示: 展开 收起
Swift 等 2 种语言
MIT
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Swift
1
https://gitee.com/mirrors/ZQEndlessPageControl.git
git@gitee.com:mirrors/ZQEndlessPageControl.git
mirrors
ZQEndlessPageControl
ZQEndlessPageControl
master

搜索帮助