Add ellipsis to TextField


#1

Is there a simple way to add an ellipsis to a TextField if the text is longer than the field width?


#2

It doesn’t look like it is possible to add this to a TextField (unless it is not editable) but it’s possible using a Label.

For android I used

@ViewChild('itemLabel')
private _itemLabelRef: ElementRef;

private _itemLabel: Label;

this._itemLabel = <Label>this._itemLabelRef.nativeElement;

if (this._itemLabel.android) {
    this._itemLabel.android.setEllipsize(android.text.TextUtils.TruncateAt.END);
}