Search code examples
iphoneuislider

How to change the thumb of my Slider and the Bar with particular image


In my app i have a slider which i need to customize. I have some pictures which i want to put on bar and thumb of the slider. Anyone can help me with this?

Thanks,


Solution

  • Did you look in the documentation? UISlider has several methods to change its appearance:

    setMinimumTrackImage:forState:
    setMaximumTrackImage:forState:
    setThumbImage:forState:
    

    If that's not enough for your needs (e.g. because one image per slider element is not enough), you'll have to subclass UISlider and probably draw the slider yourself.