Skip to content

Commit 20162e9

Browse files
FrancoisCamusErjanGavalji
authored andcommitted
Replacing LabelView by TextView for android
LabelView doesn't work. This is linked to NativeScript/NativeScript#901 Why is LabelView not supported?
1 parent 6871521 commit 20162e9

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ui/placeholder.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ The Placeholder allows you to add any native widget to your application. To do t
2424

2525
```JavaScript
2626
function creatingView(args) {
27-
var nativeView = new android.widget.LabelView(args.context);
27+
var nativeView = new android.widget.TextView(args.context);
28+
nativeView.setSingleLine(true);
29+
nativeView.setEllipsize(android.text.TextUtils.TruncateAt.END);
2830
nativeView.setText("Native");
2931
args.view = nativeView;
3032
}
@@ -34,7 +36,9 @@ exports.creatingView = creatingView;
3436
import placeholder = require("ui/placeholder");
3537

3638
export function creatingView(args: placeholder.CreateViewEventData) {
37-
var nativeView = new android.widget.LabelView(args.context);
39+
var nativeView = new android.widget.TextView(args.context);
40+
nativeView.setSingleLine(true);
41+
nativeView.setEllipsize(android.text.TextUtils.TruncateAt.END);
3842
nativeView.setText("Native");
3943
args.view = nativeView;
4044
}

0 commit comments

Comments
 (0)