文章来源:淘论文网   发布者: 毕业设计   浏览量: 23



还可以点击去查询以下关键词:
[Swift]    [NHRangeSlider]    [【Swift】NHRangeSlider]   

项目介绍:

https://github.com/thehung111/NHRangeSlider

NHRangeSlider

A custom range slider in Swift. Forked from RangeSlider with some enhancements.

Swift中的自定义范围滑块。 增强版的 RangeSlider。

Requirements

iOS: 8.0+

Xcode 8.1+

Swift 3.0+

InstallationCocoaPods

CocoaPods 1.1.0+ is required to build NHRangeSlider.

source 'https://github.com/CocoaPods/Specs.git' platform :ios, '10.0' use_frameworks! target '<Your Target Name>' do pod 'NHRangeSlider', '~> 0.1.1' end

Then, run the:

$ pod installCarthage

Put the following in your Cartfile:

github 'thehung111/NHRangeSlider' ~> 0.1.1

Run carthage update --platform iOS --no-use-binaries

Usage 使用方法Default Slider 默认

By default, the title label is not shown and the left and right thumbs will be circles (curvaceousness set to 1). You can add the view in code or via story board:

默认情况下,标题标签不显示,左右拇指将是圆圈(“curvaceousness”设置为1)。 您可以在代码或故事板中添加视图:

override func viewDidLoad() { super.viewDidLoad() // default slider. Configure the frame let sliderView = NHRangeSliderView(frame: CGRect(x: 16, y: 20, width: self.view.bounds.width - 32, height: 80) ) // call size to fit to resize the height to fit exactly sliderView.sizeToFit() self.view.addSubview(sliderView) }Slider with Square Thumbs 自定义let sliderSquareView = NHRangeSliderView(frame: ...) // set to 0 for square sliderSquareView.curvaceousness = 0.0 sliderSquareView.trackHighlightTintColor = UIColor.red sliderSquareView.lowerValue = 20.0 sliderSquareView.upperValue = 80.0 sliderSquareView.sizeToFit() self.view.addSubview(sliderSquareView)Slider with titlelet sliderSquareWithLabelView = NHRangeSliderView(frame: ...) sliderSquareWithLabelView.curvaceousness = 0.0 sliderSquareWithLabelView.trackHighlightTintColor = UIColor.brown sliderSquareWithLabelView.lowerValue = 20.0 sliderSquareWithLabelView.upperValue = 80.0 // set title text sliderSquareWithLabelView.titleLabel?.text = 'Slider with title label' sliderSquareWithLabelView.sizeToFit() self.view.addSubview(sliderSquareWithLabelView)Slider with labels following thumbslet sliderWithLabelFollowView = NHRangeSliderView(frame: ...) sliderWithLabelFollowView.trackHighlightTintColor = UIColor.black sliderWithLabelFollowView.lowerValue = 30.0 sliderWithLabelFollowView.upperValue = 70.0 sliderWithLabelFollowView.gapBetweenThumbs = 5 // set style to follow sliderWithLabelFollowView.thumbLabelStyle = .FOLLOW sliderWithLabelFollowView.titleLabel?.text = 'Slider with labels follow thumbs' sliderWithLabelFollowView.sizeToFit() self.view.addSubview(sliderWithLabelFollowView)API Reference

https://thehung111.github.io/NHRangeSlider/

开题报告开题报告


这里还有:


还可以点击去查询:
[Swift]    [NHRangeSlider]    [【Swift】NHRangeSlider]   

请扫码加微信 微信号:sj52abcd


下载地址: http://www.taolw.com/down/7967.docx
  • 上一篇:BasicFramework定制-工程基础框架
  • 下一篇:基于AVPlayer封装的视频播放器,功能丰富,快速集成,可定...