开发者

how to fix interval on UISlider,iphone

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜