tags:

views:

33

answers:

2

I am using uislider in my application.Now i want to get position of center button when i am moving slider.How it possible?

A: 

It's one of the subviews. However, accessing it like this is prone to breakage in future OS versions. You can probably make a reasonable guess of the coordinates with a little math though.

tc.
A: 
UISlider *slider = mySlider;
CGRect bounds = slider.bounds;
CGRect trackRect = [slider trackRectForBounds:bounds];
CGRect thumbPosition = [slider thumbRectForBounds:bounds trackRect:trackRect
                                            value:slider.value];

See the documentation here.

Ed Marty