UISlider thumbTintColor doesn't change on iOS 7 (fine on iOS 6)

后端 未结 4 1685
庸人自扰
庸人自扰 2021-01-08 01:41

I have an app that runs perfectly on iOS 6. I\'ve set a blinking effect to a UISlider\'s thumb this way:

-(void)startBlinkingSlider{
    isSliderBlinking = Y         


        
4条回答
  •  长发绾君心
    2021-01-08 01:57

    I discovered a workaround. By first calling the 'setThumbImage:forState:' method, the 'thumbTintColor' property will then take effect.

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

    I tested this on Version 7.0 (463.9.4.2) of iOS Simulator.

提交回复
热议问题