Skip to content

Commit 3178c8f

Browse files
committed
Update Spanish translations adding the placeholder element docs
1 parent 23b67bb commit 3178c8f

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
title: Placeholder
3+
apiRef: https://docs.nativescript.org/api-reference/classes/_ui_placeholder_.placeholder
4+
contributors: [msaelices]
5+
---
6+
7+
El elemento `<Placeholder>` te permite añadir cualquier widget nativo a tu aplicación. Para hacer eso, necesitas añadir un Placeholder donde sea en la jerarquía de tu interfaz y entonces crear y configurar el widget nativo que quieres que aparezca allí. Finalmente, pasa la vista del widget nativo como vista en los argumentos del evento `creatingView`.
8+
9+
---
10+
11+
```html
12+
<Placeholder @creatingView="creatingView" />
13+
```
14+
15+
#### Ejemplo con TextView en Android
16+
17+
```js
18+
methods: {
19+
creatingView: function(args) {
20+
const nativeView = new android.widget.TextView(args.context);
21+
nativeView.setSingleLine(true);
22+
nativeView.setEllipsize(android.text.TextUtils.TruncateAt.END);
23+
nativeView.setText("Native View - Android");
24+
args.view = nativeView;
25+
}
26+
}
27+
```
28+
29+
#### Ejemplo con UILabel en iOS
30+
31+
```js
32+
methods: {
33+
creatingView: function(args) {
34+
const nativeView = new UILabel();
35+
nativeView.text = "Native View - iOS";
36+
args.view = nativeView;
37+
}
38+
}
39+
```

0 commit comments

Comments
 (0)