Use of IOS UISlider

Source: Internet
Author: User

 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.