mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-15 19:26:42 +08:00
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:
@ -6,6 +6,8 @@
|
||||
<TextField text="left" style="text-align: left" />
|
||||
<TextField text="center" style="text-align: center" />
|
||||
<TextField text="right" style="text-align: right" />
|
||||
<!-- Text must not be predefined in the letter spacing test -->
|
||||
<TextField style="letter-spacing: 0.9em;" />
|
||||
|
||||
<WrapLayout>
|
||||
<TextField text="normal" />
|
||||
|
@ -35,6 +35,7 @@
|
||||
"gitHead": "8ab7726d1ee9991706069c1359c552e67ee0d1a4",
|
||||
"readme": "NativeScript Application",
|
||||
"scripts": {
|
||||
"clean": "npx rimraf hooks node_modules platforms package-lock.json",
|
||||
"e2e": "tsc -p e2e && mocha --opts ../config/mocha.opts --recursive e2e --appiumCapsLocation ../config/appium.capabilities.json",
|
||||
"e2e-debug": "./node_modules/.bin/ns-dev-appium --startSession",
|
||||
"e2e-watch": "tsc -p e2e --watch",
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user