MCPcopy Index your code
hub / github.com/NativeScript/NativeScript / setTintColor

Method setTintColor

packages/core/ui/image/index.ios.ts:52–65  ·  view source on GitHub ↗
(value: Color)

Source from the content-addressed store, hash-verified

50 }
51
52 private setTintColor(value: Color) {
53 if (this.nativeViewProtected) {
54 if (value && this.nativeViewProtected.image && !this._templateImageWasCreated) {
55 this.nativeViewProtected.image = this.nativeViewProtected.image.imageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate);
56 this._templateImageWasCreated = true;
57 queueGC();
58 } else if (!value && this.nativeViewProtected.image && this._templateImageWasCreated) {
59 this._templateImageWasCreated = false;
60 this.nativeViewProtected.image = this.nativeViewProtected.image.imageWithRenderingMode(UIImageRenderingMode.Automatic);
61 queueGC();
62 }
63 this.nativeViewProtected.tintColor = value ? value.ios : null;
64 }
65 }
66
67 public _setNativeImage(nativeImage: UIImage) {
68 if (this.nativeViewProtected?.image) {

Callers 2

_setNativeImageMethod · 0.95

Calls 1

queueGCFunction · 0.90

Tested by

no test coverage detected