Placeholder: A widget that allows adding native views to the visual tree.

This commit is contained in:
Rossen Hristov
2015-04-08 12:50:38 +03:00
parent 0f5e107205
commit 16822a862b
11 changed files with 145 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
import application = require("application");
application.mainModule = "main-page";
application.start();

View File

@@ -0,0 +1,7 @@
import placeholder = require("ui/placeholder");
export function creatingView(args: placeholder.CreateViewEventData) {
var nativeView = new android.widget.LabelView(args.context);
nativeView.setText("Native");
args.view = nativeView;
}

View File

@@ -0,0 +1,7 @@
import placeholder = require("ui/placeholder");
export function creatingView(args: placeholder.CreateViewEventData) {
var nativeView = new UILabel();
nativeView.text = "Native";
args.view = nativeView;
}

View File

@@ -0,0 +1,5 @@
<Page xmlns="http://www.nativescript.org/tns.xsd">
<StackLayout>
<Placeholder creatingView="creatingView"/>
</StackLayout>
</Page>

View File

@@ -0,0 +1,2 @@
{ "name" : "template-hello-world",
"main" : "app.js" }