Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do i set progress image in UIProgressView

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

like image 261
akshay202 Avatar asked Jan 12 '23 19:01

akshay202


2 Answers

Try this following code in programmatically,

[progressView setTrackImage:[UIImage imageNamed:@"track"]]; 
[progressView setProgressImage:[UIImage imageNamed:@"progress"]];
like image 184
Raj Subbiah Avatar answered Jan 14 '23 09:01

Raj Subbiah


A simple solution to override UIProgressView's tint color :

progressVw.trackTintColor = [UIColor whiteColor];  

If you want to set backColor of UIProgressView-

Use this Custom UIProgessView

If you want to set Progress image and Track Image of UIProgressView-

Refer this link Progress image and Track Image

like image 39
Vizllx Avatar answered Jan 14 '23 07:01

Vizllx