You have to use images to achieve this. Check this link to see how it is done. You cannot change color by using some property of UISlider.
Also check out sample code in the UICatalog sample code app posted by Apple.
UPDATE:
Since you need further clarification, read these lines from docs:
*
The bar on which the thumb rides is referred to as the slider’s track.
Slider controls draw the track using two distinct images, which are
customizable. The region between the thumb and the end of the track
associated with the slider’s minimum value is drawn using the minimum
track image. The region between the thumb and the end of the track
associated with the slider’s maximum value is drawn using the maximum
track image. Different track images are used in order to provide
context as to which end contains the minimum value. For example, the
minimum track image typically contains a blue highlight while the
maximum track image contains a white highlight. You can assign
different pairs of track images to each of control states of the
slder. Assigning different images to each state lets you customize the
appearance of the slider when it is enabled, disabled, highlighted,
and so on.
*
So, if you want to change the color continuously, you have to have images of all colors. Put them in a NSArray
or NSDictionary
(with key as your color name) and use it dynamically.