From 4de4d803556d5d5bee0745b2f60e3eee6e3caca2 Mon Sep 17 00:00:00 2001 From: Martin Guillon Date: Wed, 9 Feb 2022 11:43:25 +0100 Subject: [PATCH] fix(ios): fix color change with HTML / formattedString --- src/label.ios.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/label.ios.ts b/src/label.ios.ts index 2b10632..68d610d 100644 --- a/src/label.ios.ts +++ b/src/label.ios.ts @@ -393,7 +393,7 @@ export class Label extends LabelBase { fontSize, familyName, fontWeight, - color: this.color, + // color: this.color, letterSpacing: this.letterSpacing, lineHeight: this.lineHeight, textAlignment: this.nativeTextViewProtected.textAlignment @@ -440,11 +440,11 @@ export class Label extends LabelBase { this.nativeTextViewProtected.setTitleColorForState(color, 0 /* Normal */); this.nativeTextViewProtected.titleLabel.textColor = color; } else { - if (this.formattedText || this.html) { - this._setNativeText(); - } else { - this.nativeTextViewProtected.textColor = color; - } + // if (this.formattedText || this.html) { + // this._setNativeText(); + // } else { + this.nativeTextViewProtected.textColor = color; + // } } } [linkColorProperty.setNative](value: Color | string) { @@ -558,6 +558,10 @@ export class Label extends LabelBase { } else { super._setNativeText(); } + if (this.color) { + const color = this.color instanceof Color ? this.color.ios : this.color; + this._setColor(color); + } this.updateTextContainerInset(); this._requestLayoutOnTextChanged(); }