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: >
You need to set the initial thumb image using setThumbImage forState. This works fine for me in iOS7 and returns the correct width of the image. The slider is setup in a storyboard and connected via an IBOutlet.
- (void)viewDidLoad
{
[super viewDidLoad];
[self.slider setThumbImage:[UIImage imageNamed:@"tick.jpg"] forState:UIControlStateNormal];
float check = self.slider.currentThumbImage.size.width;
NSLog(@"Check is %f", check);
}