0

Background : Suppose if the slider values ranges from 0 to 1000. If we slide the values assumably logged will be in the order 0,5,10.... 1000 But, we cannot select "1" to be precise.

Problem : I want to create a more zoomed effect like the magnification appears over the textfield on long-press to enter values precisely using a slider. How to achieve that ?

Any relevant help/suggestion/library/link/code snippet/discussion appreciated.

Cheers! Jeet

jeet.chanchawat
  • 5,842
  • 5
  • 38
  • 59
  • 1
    For values this big using UISlider is a bad for usage and end user experience. Think of this way, if you have a code that has 40K lines, when you scroll, do you think you will get to line 1? Most likely not. So either break your 0-1000 in chucks of 50 or 100 or use number input, dial or something. – Sam B Oct 09 '15 at 16:27

1 Answers1

1

One approach would be to copy the interaction the default video player scrubber uses. Horizontal movements still affect moving the slider knob. Moving your finger away vertically from the control affects the level of detail while sliding horizontally. The further you move away vertically the more precise the scrubber values adjust while sliding.

Use a UIPanGestureRecognizer for custom event handling in a UISlider subclass for example.

Joris Kluivers
  • 11,894
  • 2
  • 48
  • 47