iOS UISlider Summary

Source: Internet
Author: User

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

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.