سؤال

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

هل كانت مفيدة؟

المحلول

Try this following code in programmatically,

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

نصائح أخرى

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

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top