I want to add another component like layout, button, image, etc...
This my xml code and I want to add xml on stacklayout which ID is "chatbox":
<GridLayout orientation="vertical" rows="*, auto" columns="auto,*, auto">
<ScrollView row="0" colSpan="3" col="0">
<StackLayout id="chatbox">
// I want to add XML component here dynamically
</StackLayout>
</ScrollView>
Here's my current typescript code but it doesn't work. It doesn't even show compile error.
export function onSendButtonTap(args: EventData){
const button = <Button>args.object;
const bindingContext = <HomeViewModel>button.bindingContext;
const page = <Page>args.object;
const stack = new StackLayout();
stack.getViewById("chatbox");
const label = new Label();
label.text = "label";
stack.addChild(label);;
bindingContext.sendMessage(); }