jailani
jailani

Reputation: 2270

UISlider thumb image is hidden on sliding

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

Answers (2)

Pranay Jadhav
Pranay Jadhav

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

Balaji Ramakrishnan
Balaji Ramakrishnan

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

Related Questions