UISlider behaviour in iOS7 versus iOS6

前端 未结 3 999
不知归路
不知归路 2020-12-29 11:46

I noticed that UISlider in iOS7 behaves differently than it did in iOS 6 and iOS 5:

Say you have a slider with min=0 and max=10, current value is 0. When you first t

3条回答
  •  温柔的废话
    2020-12-29 11:54

    On iOS 9 you need to set for .Normal, .Selected and .Highlighted states to work. I found this after 5h of struggling. Way to go Apple!

    [_sliderView setThumbImage:[UIImage imageNamed:@"knob"] forState:UIControlStateNormal];
    [_sliderView setThumbImage:[UIImage imageNamed:@"knob"] forState:UIControlStateSelected];
    [_sliderView setThumbImage:[UIImage imageNamed:@"knob"] forState:UIControlStateHighlighted];
    

提交回复
热议问题