mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 11:42:04 +08:00
27 lines
806 B
TypeScript
27 lines
806 B
TypeScript
import { Label as LabelDefinition } from ".";
|
|
import { TextBase, WhiteSpace } from "../text-base";
|
|
|
|
export * from "../text-base";
|
|
|
|
export class Label extends TextBase implements LabelDefinition {
|
|
private _android: android.widget.TextView;
|
|
|
|
get textWrap(): boolean {
|
|
return this.style.whiteSpace === WhiteSpace.NORMAL;
|
|
}
|
|
set textWrap(value: boolean) {
|
|
this.style.whiteSpace = value ? WhiteSpace.NORMAL : WhiteSpace.NO_WRAP;
|
|
}
|
|
|
|
get android(): android.widget.TextView {
|
|
return this._android;
|
|
}
|
|
|
|
public _createNativeView() {
|
|
const textView = this._android = new android.widget.TextView(this._context);
|
|
textView.setSingleLine(true);
|
|
textView.setEllipsize(android.text.TextUtils.TruncateAt.END);
|
|
return textView;
|
|
}
|
|
}
|