开发者

How to detect coordinate of UISLDER?

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


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜