How do i set progress image in UIProgressView

akshay202 picture akshay202 · Nov 28, 2013 · Viewed 9.8k times · Source

I am trying to set Progress image and Track image for UIProgress view using the designer, preview screen shows me the desired view with track image as the background of the progress bar and Progress image used for progress bar. But when i run my code both the images are not getting used instead progress is displayed using the background color and tint color of the View. Can someone tell me how to override the tint color and background color and use Progress image and Track Image property.

enter image description here

Answer

Raj Subbiah picture Raj Subbiah · Nov 28, 2013

Try this following code in programmatically,

[progressView setTrackImage:[UIImage imageNamed:@"track"]]; 
[progressView setProgressImage:[UIImage imageNamed:@"progress"]];