Skip to content

Commit 2aadecf

Browse files
authored
fix(ios): autoFontSize working with NSAttributedString in text property
1 parent 93c56ca commit 2aadecf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/label/index.ios.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -877,9 +877,9 @@ export class Label extends LabelBase {
877877
let expectSize;
878878

879879
const stepSize = this.autoFontSizeStep || 2;
880-
880+
const changeFont = !(this.formattedText || this.html || this.text instanceof NSAttributedString);
881881
const updateFontSize = (font) => {
882-
if (this.formattedText || this.html) {
882+
if (!changeFont) {
883883
NSLabelUtils.updateFontRatioRatio(textView, font.pointSize / fontSize);
884884
} else {
885885
textView.font = font;
@@ -905,7 +905,7 @@ export class Label extends LabelBase {
905905
expectFont = newFont;
906906
} else {
907907
expectFont = newFont;
908-
if (!this.formattedText && !this.html) {
908+
if (changeFont) {
909909
textView.font = newFont;
910910
}
911911
break;

0 commit comments

Comments
 (0)