2

[slider setThumbTintColor:color]在iOS 7.1中无效。

是否有任何解决方法可以将拇指颜色设置为任何随机颜色(不是图像)

编辑

使用 tint color 时,拇指大小更小:

  • 色调:在此处输入图像描述
  • 色调:在此处输入图像描述
4

2 回答 2

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

你能这样试试吗

图片链接:

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

于 2014-03-14T12:11:32.423 回答
1

尝试使用以下代码

[[UISlider appearance] setThumbTintColor:color];

编辑:

第一组UIImageThumbImage这样

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

然后使用以下代码。

self.slider.thumbTintColor = color;
于 2014-03-14T12:02:57.747 回答