How to read size of UISlider thumb image

前端 未结 5 1269
一生所求
一生所求 2021-01-18 07:02

I\'m trying to position an additional UIView centered above the thumb in a UISlider. To do this, I need the width of the thumb image. In iOS6, this works fine. I can use:

5条回答
  •  情深已故
    2021-01-18 08:04

    I use this in my subclass:

    CGRect trackRect = [self trackRectForBounds:self.bounds];
    CGRect thumbRect = [self thumbRectForBounds:self.bounds trackRect:trackRect value:0];
    CGSize thumbSize = thumbRect.size;
    

提交回复
热议问题