0

Is there a way to display the Slider value over the ThumbImage?
I was thinking of getting the X position of the ThumbImage and then moving a UILabel accordingly.
Is that possible?

Adhamox
  • 397
  • 10
  • 19
  • wouldn't the user's thumb cover that up? – willc2 Mar 01 '10 at 14:41
  • it might.But When he removes his thumb it will be viewable. Smart catch anyways :) – Adhamox Mar 02 '10 at 13:39
  • I found the answer in an earlier question here: http://stackoverflow.com/questions/1714405/how-to-get-the-center-of-the-thumb-image-of-uislider That worked for me well. thanks – Adhamox Mar 02 '10 at 13:47

1 Answers1

0

Unfortunately, you have to do this yourself. I did something like it for shakedown. As you can see there, I put a UILabel above the slider so that the user could see as they manipulated.

Luckily, it's pretty easy to do. Simply send the slider a message like addTarget:action:forControlEvents:, with a method you create as the "action" parameter. This method will then get called whenever the thumb is moved (depending on your forControlEvents value). Inside of that method, check the UISlider's value property and update the UILabel accordingly.

bpapa
  • 21,409
  • 25
  • 99
  • 147