UISlider setMaximumTrackTintColor

前端 未结 6 827
情书的邮戳
情书的邮戳 2021-01-01 22:34

I\'m trying to dynamically configure the track color on a UISlider.

This line of code works perfectly for setting the low side of the slider track.

[

6条回答
  •  醉梦人生
    2021-01-01 22:39

    That is strange, both min and max work fine for me and I can even have it animate color change. All I can suggest is re-create the slider and also @synthesize.

    @synthesize slider;
    
    - (void)viewDidLoad
    {
    [super viewDidLoad];
    [slider setMinimumTrackTintColor:[UIColor orangeColor]];
    [slider setMaximumTrackTintColor:[UIColor blueColor]];
    
    
    
    // Do any additional setup after loading the view, typically from a nib.
    }
    

    Slider with 2 different colors

提交回复
热议问题