fix(text-base): apply letter spacing in ios text field (#8618)

This commit is contained in:
dosomder
2020-06-06 19:41:42 +02:00
committed by GitHub
parent f7310d9cc1
commit e2a9af2bc7

View File

@ -281,7 +281,11 @@ export class TextBase extends TextBaseCommon {
} }
if (style.letterSpacing !== 0) { if (style.letterSpacing !== 0) {
dict.set(NSKernAttributeName, style.letterSpacing * this.nativeTextViewProtected.font.pointSize); const kern = style.letterSpacing * this.nativeTextViewProtected.font.pointSize
dict.set(NSKernAttributeName, kern);
if (this.nativeTextViewProtected instanceof UITextField) {
this.nativeTextViewProtected.defaultTextAttributes.setObjectForKey(kern, NSKernAttributeName);
}
} }
const isTextView = this.nativeTextViewProtected instanceof UITextView; const isTextView = this.nativeTextViewProtected instanceof UITextView;