fix(text-base): letter spacing for textfield (#8627)

closes https://github.com/NativeScript/NativeScript/pull/8626
closes https://github.com/NativeScript/NativeScript/issues/4892
This commit is contained in:
Nathan Walker
2020-06-09 22:44:16 -07:00
committed by GitHub
parent ae06202af5
commit eb4c61fc41
3 changed files with 6 additions and 0 deletions

View File

@ -288,6 +288,9 @@ export class TextBase extends TextBaseCommon {
if (style.letterSpacing !== 0 && this.nativeTextViewProtected.font) {
const kern = style.letterSpacing * this.nativeTextViewProtected.font.pointSize;
dict.set(NSKernAttributeName, kern);
if (this.nativeTextViewProtected instanceof UITextField) {
this.nativeTextViewProtected.defaultTextAttributes.setValueForKey(kern, NSKernAttributeName);
}
}
if (style.color) {