Shishir.bobby
Shishir.bobby

Reputation: 10984

how to fix interval on UISlider,iphone

I have Slider,which works perfect. But what i am trying to do is, for ex, min =0 and max=50 and x=0 every time i slide or use buttons to change the value of slider, the interval should be of 5 only. i.e x should be equal to only 0,5,10,15.....50

Suggestions. Thanks

Upvotes: 0

Views: 367

Answers (1)

Snips
Snips

Reputation: 6773

In the callback (value changed) - read the value, round it up or down to the nearest increment of 5, then set the slider to your preferred value. That way, it will 'jump' between your preferred values.

Upvotes: 3

Related Questions