UIProgressView: trackTintColor property
The trackTintColor property is the color of the progress bar's unfilled portion.
Value
A color string, or null.
- Readable and writable.
- Defaults to
null: not set separately, so the system default color is used. - A valid color you write reads back as is. You can also write a
UIColorobject, which reads back as a color string; for example, writingUIColor.systemRedColorreads back'systemRed'. - Writing
nullrestores the system default color. - Either this or
trackImage, not both: writing a color setstrackImagetonull. Writingnullto the color doesn't affect the image; see Color or image, not both. - How the color looks on screen is not verified in the simulator.
- There is no change event. Only the app's own code changes it.
Invalid values
Writing an invalid color doesn't throw; a warning is printed to the console and the color keeps its previous value. See Colors.
Examples
js
const bar = new UIProgressView();
bar.trackTintColor = '#E5E5EA';
console.log(bar.trackTintColor);Result: Prints #E5E5EA. The progress bar's unfilled portion takes this color.
Corresponding iOS API
UIProgressView.trackTintColor. A UIColor object in ObjC; here it reads back as a color string.
See also
trackImage: using an image instead of a color- Colors: how to write color strings