@@ -252,6 +252,10 @@ export class Label extends LabelBase {
252
252
return result . height ;
253
253
}
254
254
255
+ useNSAttributedString ( ) {
256
+ return this . formattedText || this . html || ( this . text instanceof NSAttributedString )
257
+ }
258
+
255
259
updateVerticalAlignment ( applyVerticalTextAlignment = true ) {
256
260
const nativeView = this . nativeTextViewProtected ;
257
261
if ( ! this . mCanUpdateVerticalAlignment ) {
@@ -407,7 +411,7 @@ export class Label extends LabelBase {
407
411
// if (this.isUsingNSTextView) {
408
412
// desiredSize.height += nativeView.textContainerInset.top + nativeView.textContainerInset.bottom;
409
413
// }
410
- if ( resetFont && ! this . formattedText && ! this . html ) {
414
+ if ( resetFont && this . useNSAttributedString ( ) ) {
411
415
nativeView . font = resetFont ;
412
416
}
413
417
@@ -653,7 +657,7 @@ export class Label extends LabelBase {
653
657
const nativeView = this . nativeTextViewProtected ;
654
658
const newFont : UIFont = value instanceof Font ? value . getUIFont ( nativeView . font ) : value ;
655
659
nativeView . font = newFont ;
656
- if ( this . formattedText || this . html ) {
660
+ if ( this . useNSAttributedString ( ) ) {
657
661
this . _setNativeText ( ) ;
658
662
}
659
663
}
@@ -877,7 +881,7 @@ export class Label extends LabelBase {
877
881
let expectSize ;
878
882
879
883
const stepSize = this . autoFontSizeStep || 2 ;
880
- const changeFont = ! ( this . formattedText || this . html || this . text instanceof NSAttributedString ) ;
884
+ const changeFont = ! this . useNSAttributedString ( ) ;
881
885
const updateFontSize = ( font ) => {
882
886
if ( ! changeFont ) {
883
887
NSLabelUtils . updateFontRatioRatio ( textView , font . pointSize / fontSize ) ;
0 commit comments