Add textview when click button

nativescriptcore

#1

i want to add textview to page when i click button, please tell me about your solution


#2

Should be easy,

import * { TextView } from "ui/text-view";
...
...
var textView = new TextView();
parentLayout.addChild(textView);

#3

And incase you use JS version of nativescript

Just switch the import statement with

const TextView = require("ui/text-view").TextView;