mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Re-apply TextBase.formattedText after a style property change
Resolves #1078
This commit is contained in:
17
ui/text-base/text-base.android.ts
Normal file
17
ui/text-base/text-base.android.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
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) {
|
||||
if (this.android) {
|
||||
var newValue = types.isNullOrUndefined(data.newValue) ? "" : data.newValue + "";
|
||||
this.android.setText(newValue);
|
||||
}
|
||||
}
|
||||
public _setFormattedTextPropertyToNative(value) {
|
||||
if (this.android) {
|
||||
this.android.setText(value._formattedText);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user