UISlider增量 [英] UISlider increments
本文介绍了UISlider增量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个UISlider,可以在0.0到1.0的范围内滑动.
I have a UISlider that slides with a range from 0.0 to 1.0.
开箱即用,该滑块使用户能够以很高的分数位数进行滑动,但是我只希望我的用户能够为滑块的每次滴答"增加/减少.001.
Out of the box, the slider lets users slide with a really high number of fraction digits, but I only want my users to be able to increment/decrement by .001 for each "tick" up or down of the slider.
可以设置吗?
谢谢!
推荐答案
此滑块有多大?即使您在横向模式下将其跨过屏幕的整个宽度,将0.001的更改也仅约占半个像素.听起来您只需要将滑块的值(在幕后)四舍五入到您想要的精度即可.
How big is this slider? Even if you've got it spanning the full width of the screen in landscape mode, a change of 0.001 is only about half a pixel. It sounds like you just need to round the slider's value (behind the scenes) to the precision you're after.
这篇关于UISlider增量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文