forked from NativeScript/NativeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtext-base.ios.ts
More file actions
27 lines (24 loc) · 1.08 KB
/
text-base.ios.ts
File metadata and controls
27 lines (24 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import common = require("./text-base-common");
import types = require("utils/types");
import dependencyObservable = require("ui/core/dependency-observable");
export class TextBase extends common.TextBase {
public _onTextPropertyChanged(data: dependencyObservable.PropertyChangeData) {
var newValue = types.isNullOrUndefined(data.newValue) ? "" : data.newValue + "";
this.ios.text = newValue;
this.style._updateTextDecoration();
this.style._updateTextTransform();
}
public _setFormattedTextPropertyToNative(value) {
this.ios.attributedText = value._formattedText;
this.style._updateTextDecoration();
this.style._updateTextTransform();
this.requestLayout();
}
public _onStylePropertyChanged(property: dependencyObservable.Property): void {
if (this.formattedText) {
// Re-apply the formatted text to override style changes if needed.
// https://github.com/NativeScript/NativeScript/issues/1078
this._setFormattedTextPropertyToNative(this.formattedText);
}
}
}