UIProgressView: progressImage property
The progressImage property is the image used for the progress bar's filled portion.
Value
UIImage, or null.
- Readable and writable.
- Defaults to
null. - It reads back as the same object you wrote.
- Writing
nullremoves the image. - Either this or
progressTintColor, not both: writing an image setsprogressTintColortonull; writing a color afterward sets the image tonull. See Color or image, not both. - How the image is stretched and cropped is not verified in the simulator.
- There is no change event. Only the app's own code changes it.
Invalid values
Writing a value other than a UIImage or null throws TypeError, and the previous value is unchanged:
- Writing another native object (for example a
UIColor):progressImage needs a UIImage or null. - Writing a plain value such as a string:
progressImage needs a native object or null, got "star.fill".
Examples
js
const bar = new UIProgressView();
bar.progressTintColor = 'systemRed';
const star = UIImage.systemImageNamed('star.fill');
if (star) bar.progressImage = star;
console.log(bar.progressTintColor);Result: Prints null. Writing the image made the system clear the color just written, and the filled portion uses this image instead.
Corresponding iOS API
UIProgressView.progressImage.
See also
progressTintColorUIImage: where images come from