UISlider Properties Summary:
1. MinimumValue: When the value can be changed, the slider can slide to the minimum position, the default is 0.0
_slider. MinimumValue =5.0;
2. MaximumValue: When the value can be changed, the slider can slide to the maximum position, the default is 1.0
_slider. MaximumValue =30.0;
3. Continuous : If you set yes, the value of the slider changes whenever you drag the slider. The default setting is Yes
[_slidersetcontinuous:NO]; // gets the value of the slider at the end of the slider slide
4. Minimumvalueimage: Picture set at minimum slider bar, default to nil _slider. minimumvalueimage =[UIImageimagenamed:@ "Minimg.png"];
5. Maximumvalueimage, the picture set at the maximum slider bar, the default is nil
_slider. maximumvalueimage = [UIImageimagenamed:@ "Maximg.png"];
6.minimumTrackTintColor: Less than the slider's current value slider bar color, default is blue
_slider. Minimumtracktintcolor = [uicoloryellowcolor];
7.maximumTrackTintColor: The color of the slider bar is greater than the current value of the slider, default is white
_slider. Maximumtracktintcolor = [uicolorbluecolor];
8.thumbTintColor: The color of the current slider, default is white
_slider. Thumbtintcolor = [uicolorredcolor];
9.currentMaximumTrackImage: Picture set at maximum slider bar10.currentMinimumTrackImage: Picture that is set at the minimum value of the slider bar11.currentThumbImage: Picture of the current sliderSliding Events:
[self. Slider addTarget:selfAction:@selector (Slidervaluechange) forcontrolevents : uicontroleventvaluechanged ];
Here because the above has been set
Implement response events just fine. continuous is no, so the response event is called only when the user stops sliding.
-(void) slidervaluechange
{
}
// let slider control rotate 90 degrees
cgaffinetransform myrotation =cgaffinetransformmakerotation(- 1.57 );
self. Slider . Transform = myrotation;
and change the thumb.
[self. Slider Setthumbimage:image1 forstate:uicontrolstatenormal];
Change bar and drag effect
[self. Myslider setminimumtrackimage:image2 Forstate:[uicontrolstatenormal]; //Overlay picture
[self. Myslider setmaximumtrackimage:image3 Forstate:[uicontrolstatenormal]; Negatives
Rotate the slider control 90 degrees vertically
Cgaffinetransformrotation =Cgaffinetransformmakerotation(-1.57079633);
self. Volumeslider. Transform = rotation;
//Heel change Thumb
  [self . volumeslider setthumbimage : image1 forstate : UIControlStateNormal ];
Change Bar and drag effect
// Overlay Picture
[ Self.VolumesliderSetminimumtrackimage: Image2Forstate:UIControlStateNormal];
//negatives
[ Self.VolumesliderSetmaximumtrackimage: ImageForstate:UIControlStateNormal];
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
iOS UISlider Summary