WLRangeSlider是自定义的slider,具有左右两个滑块,可更改滑块颜色,圆角以及轨迹的颜色和高亮。
示例代码:
WLRangeSlider *rangeSlider = [[WLRangeSlider alloc] initWithFrame:CGRectMake(20, 100, 280, 31)]; [rangeSlider addTarget:self action:@selector(valueChanged:) forControlEvents:UIControlEventValueChanged]; [self.view addSubview: rangeSlider]; //you can change the left/right value,and set different color for track and left/right thumbs,also the cornorRadius of the thumb.like this rangeSlider.trackHighlightTintColor = [UIColor redColor]; rangeSlider.thumbColor = [UIColor greenColor]; rangeSlider.cornorRadiusScale = 0;