I have a UISLider
with certain values assigned to its each step. I'm getting those values from another VC and if the value is greater than the beginning of the slider, let's say the value is 50 out of 100 possible, I want to move the handle of the slider to represent that value, apparently to the middle and so on.
How do you do this easy task in iOS?
Uh.. have you tried calling setValue:animated
?
Or reading the docs?
By default UISlider
value should be between 0 and 1 (unless you've set minimumValue
& maximumValue
)
[yourSlider setValue:0.5 animated:YES];
See UISlider
documentation for more information: http://developer.apple.com/library/ios/#documentation/uikit/reference/UISlider_Class/Reference/Reference.html
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.