设置slider当前位置的图像
[slider setThumbImage:[UIImage imageNamed:@"dd.png"] forState:UIControlStateNormal];
设置起始的颜色
[slider setMinimumTrackTintColor:[ComHelper colorWithHex:SYSTEM_BLUE_COLOR]]
设置末尾的颜色
[slider setMaximumTrackTintColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.5]]
设置为竖直的
slider.transform = CGAffineTransformMakeRotation(-M_PI_2);
重新设置slider的frame,并且设置为数值的
一定要先设置transform为标准的,在设置frame,再设置transformslider.transform = CGAffineTransformIdentity;
slider.frame = CGRectMake(0, 0, sliderLength, 20);
[slider setCenter:CGPointMake(xCenter, yCenter)];
slider.transform = CGAffineTransformMakeRotation(-M_PI_2);
动态改变slider的值
UIView.animateWithDuration(0.2, animations: {
self.mySlider.setValue(0, animated:true)
})