views:

201

answers:

2

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?

A: 

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
this would display the value. But won't get me the coordinates of the thumbimage. right?
Adhamox
A: 

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