Reputation: 2270
I have set thumb image for UISlider. This image is not reflected when i drag the slider. Once I finish the dragging then It is appearing.
I have set the image for all states
[self.myslider setThumbImage:[UIImage imageNamed:kPlayerScreenHandleImage] forState:UIControlStateNormal];
[self.myslider setThumbImage:[UIImage imageNamed:kPlayerScreenHandleImage] forState:UIControlStateSelected];
Upvotes: 2
Views: 3063
Reputation: 21
You should set both images, that is while normal and also during highlight
rangeSlider.setThumbImage(UIImage(named : "yourImage"), for: .normal)
rangeSlider.setThumbImage(UIImage(named : "yourImage"), for: .highlighted)
Upvotes: 2
Reputation: 1949
Use UIControlStateHighlighted
to Show thumb image while dragging.
like below.
[self.myslider setThumbImage:[UIImage imageNamed:kPlayerScreenHandleImage] forState:UIControlStateHighlighted];
Hope it helps..
Upvotes: 8