1
votes

Using Javascript with Nativescript and I am loading a page through code rather than XML.

I have it all working, however I want to add a ScrollView and then place a layout with in that.

How would I go about this?

I have tried:

var scroll = new ScrollView();
var stackLay = new StackLayout();

stackLay.addChild(stuff);
....


scroll.addChild(stackLay);

However, I get error "scroll.addChild is not a function"

Thanks.

1

1 Answers

2
votes

ScrollView is not a layout but inherited from ContentView, therefore you can't add more than one child.

Try

scroll.content = stackLay;