To keep it short and simple, I'm doing a mosync nativeUI javascript project. Here's part of my code:
var myScreen = mosync.nativeui.create("Screen" ,"myScreen", {
"title": "My Screen"
});
//Create a Button
var myButton = mosync.nativeui.create("Button" ,"myButton",
{
//properties of the button
"width": "FILL_AVAILABLE_SPACE",
"text": "Click Me!"
});
var myLayout = mosync.nativeui.create("VerticalLayout", "myLayout",
{
"data-width":"FILL_AVAILABLE_SPACE",
"data-height":"FILL_AVAILABLE_SPACE"
});
myLayout.addTo("myScreen");
//myButton.addTo("myLayout");
myLayout.addChild("myButton");
This works, I get a new tab in my screen and the button is there.
But, if I change the last two lines and use addTo instead of addChild for adding the button to the layout, the button is not displayed.
Shouldn't the myButton.addTo("myLayout") be the same as myLayout.addChild("myButton")??