문제

[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:

  • with tint: enter image description here
  • without tint: enter image description here
도움이 되었습니까?

해결책

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

Can you try like this

Image links :

1x: http://i.imgur.com/EYgg4xc.png 2x: http://i.imgur.com/D3fUnxD.png

다른 팁

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;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top