iOS实现带刻度的UISlider

非常好用的带刻度的Slider

截图

image

导入:

使用cocoaPods:

pod 'JFMarkSlider'

使用swift package manager:

依次点击Xcode菜单:

File -> Swift Packages -> Add Package Dependency

在输入框中输入:https://github.com/hxwxww/JFMarkSlider.git

用法

基本用法:

  • 代码如下:
    slider.minimumMarkTintColor = .black
    slider.maximumMarkTintColor = .lightGray
    slider.isStayToMark = true
    slider.markStyle = .image(image: UIImage(named: "bullet")!.withRenderingMode(.alwaysTemplate))
    slider.markValues = [0.2, 0.4, 0.6, 0.8]

更具体的用法及参数设置,请下载 Demo 查看。

“iOS实现带刻度的UISlider”的回复:

  1. I prefer the 1959 rendition. His voice had far more resonance plus a rounder and deeper sound. But, either one is fantastic. Margeaux Dwight Greiner

  2. Way cool! Some extremely valid points! I appreciate you writing this article plus the rest of the website is also really good. Linea Hieronymus Moazami

发表评论

邮箱地址不会被公开。 必填项已用*标注