开发者

how to fix interval on UISlider,iphone

开发者 https://www.devze.com 2023-04-08 05:43 出处:网络
I hav开发者_如何学运维e Slider,which works perfect. But what i am trying to do is, for ex, min =0 and max=50 and x=0

I hav开发者_如何学运维e 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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消