Search code examples
objective-cuislider

UISlider background disappears


I use UISlider for video player to track and change the location of the playback.

It seems that when ever I change the slider.value from code, the background line of the slider disappears.

It changes from this:

enter image description here

to this:

enter image description here

(I added the gray background color)

What can cause this issue?


Solution

  • Solved.

    As trojanfoe suggested, I looked at this question:

    iOS - iPhone : UISlider track image disappearing randomly

    In simple words: I used [UISlider setValue:animated:] and made sure I don't get NaN, which was the real problem.