BRPageControl 是一个自定义的 UIView,它模仿 UIPageControl 的行为,并具有一些额外的功能。
可以为您的控件添加边框,并为其指定自定义的 UIColor。
设置控件的自定义直径
设置控件之间的自定义间距
BRPageControl 可以通过 CocoaPods 安装
CocoaPods
只需将 pod 'BRPageControl'
添加到您的 podfile 文件中,然后运行 pod install
Carthage
gitHub "kjoneandrei/BRPageControl"
创建一个 BRPageControl 的实例
let brPageControl = BRPageControl()
设置 BRPageControl 对齐方式
brPageControl.contentHorizontalAlignment = .center
通过访问以下属性为您的控件设置颜色
brPageControl.currentPageTintColor = .white
brPageControl.currentPageBorderColor = .black
brPageControl.pageTintColor = .gray
brPageControl.pageBorderColor = .black
设置直径和间距
brPageControl.diameter = 7.5
brPageControl.spacing = 7
由 Andrei Hogea 制作
BRPageControl 在 MIT 许可证下可用。