user623396
user623396

Reputation: 1547

iOS 7.1 UISlider setThumbTintColor

[slider setThumbTintColor:color] has no effect in iOS 7.1.

Is there any workaround for setting the thumb color to any random color (not an image)?

EDIT

The thumb size is smaller when using tint color:

Upvotes: 2

Views: 3941

Answers (2)

iPatel
iPatel

Reputation: 47099

Try with following code

[[UISlider appearance] setThumbTintColor:color];

EDITED :

First set UIImage as ThumbImage such like

[self.slider setThumbImage:[UIImage imageNamed:@"Thumb.png"] forState:UIControlStateNormal];

Then use following code.

self.slider.thumbTintColor = color;

Upvotes: 1

Prashanth
Prashanth

Reputation: 463

[self.slider setThumbImage:[UIImage imageNamed:@"Thumb.png"] forState:UIControlStateNormal];
self.slider.thumbTintColor = [UIColor blackColor];

Can you try like this

Image links :

1x: https://i.sstatic.net/pjgvn.png 2x: https://i.sstatic.net/VIMT5.png

Upvotes: 2

Related Questions