Skip to content

Commit 4de4d80

Browse files
committed
fix(ios): fix color change with HTML / formattedString
1 parent 7af7ba4 commit 4de4d80

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Diff for: src/label.ios.ts

+10-6
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ export class Label extends LabelBase {
393393
fontSize,
394394
familyName,
395395
fontWeight,
396-
color: this.color,
396+
// color: this.color,
397397
letterSpacing: this.letterSpacing,
398398
lineHeight: this.lineHeight,
399399
textAlignment: this.nativeTextViewProtected.textAlignment
@@ -440,11 +440,11 @@ export class Label extends LabelBase {
440440
this.nativeTextViewProtected.setTitleColorForState(color, 0 /* Normal */);
441441
this.nativeTextViewProtected.titleLabel.textColor = color;
442442
} else {
443-
if (this.formattedText || this.html) {
444-
this._setNativeText();
445-
} else {
446-
this.nativeTextViewProtected.textColor = color;
447-
}
443+
// if (this.formattedText || this.html) {
444+
// this._setNativeText();
445+
// } else {
446+
this.nativeTextViewProtected.textColor = color;
447+
// }
448448
}
449449
}
450450
[linkColorProperty.setNative](value: Color | string) {
@@ -558,6 +558,10 @@ export class Label extends LabelBase {
558558
} else {
559559
super._setNativeText();
560560
}
561+
if (this.color) {
562+
const color = this.color instanceof Color ? this.color.ios : this.color;
563+
this._setColor(color);
564+
}
561565
this.updateTextContainerInset();
562566
this._requestLayoutOnTextChanged();
563567
}

0 commit comments

Comments
 (0)