UISlider is a handy control that enables users to visually set values within a specified range.
Like a button, the slider responds to events and can be read like a text box. If you want the user's adjustment of the slider to affect the application immediately, you need to let him trigger the action.
Here are a few things to learn
UISlider * slider = [[UISlider alloc]initwithframe:cgrectmake (Ten, -, -, -)]; //01.minimumValue: When the value can be changed, the slider can slide to the minimum position, the default is 0.0Slider.minimumvalue =0.0; //02.maximumValue: When the value can be changed, the slider can slide to the maximum position, the default is 1.0Slider.maximumvalue =100.0; //03. Current ValueSlider.value = -; //04.continuous: If you set yes, the value of the slider changes whenever you drag the slider. The default setting is Yes[Slider Setcontinuous:yes]; //05. Picture set at minimum slider bar, default to nilSlider.minimumvalueimage = [UIImage imagenamed:@"001.jpeg"]; //06. Picture set at maximum slider bar, default to nilSlider.maximumvalueimage = [UIImage imagenamed:@"001.jpeg"]; //07.minimumTrackTintColor: Less than the slider's current value slider bar color, default is blueSlider.minimumtracktintcolor =[Uicolor Redcolor]; //08.maximumTrackTintColor: The color of the slider bar is greater than the current value of the slider, default is whiteSlider.maximumtracktintcolor =[Uicolor Bluecolor]; //09.thumbTintColor: The color of the current slider, default is whiteSlider.thumbtintcolor =[Uicolor Yellowcolor]; //10.currentMaximumTrackImage: Picture set at maximum slider bar//11.currentMinimumTrackImage: Picture that is set at the minimum value of the slider bar//12.currentThumbImage: Picture of the current slider[Slider addtarget:self action: @selector (slidervaluechanged:) forcontrolevents:uicontroleventvaluechanged];
-(void) slidervaluechanged: (UISlider *) slider{ NSLog (@ "slider value%f ", Slider.value);}
Use of IOS UISlider