Unable to add text/rect into newScrollView

Hi,

Is it only me, but I am unable to add text or rect inside a widget.newScrollView ?

For example (this is a code extract. group is good, widget is included, etc) : 

    local scrollView = widget.newScrollView

{

    top = 100,

    left = 10,

    width = 300,

    height = 400,

    scrollWidth = 600,

    scrollHeight = 800,

}

    group:insert( scrollView )

    local text = display.newText( scrollView, “this is a test”, 0,0, nil, 20 )

    text:setFillColor( 0,0,0)

The text will never scroll and will not be positioned properly inside the scrollview.

This is happening with build 2100 and 2155 (just try the latest build).

In your code ‘scrollView’ cannot be used as a group. I think the actual group is something like scrollView._view, but the best way (read: safest, most future-proof) is to use scrollView:insert( text ), so you create the text first and then insert it into the scroll view.

Yes, there is a regular display group which you can access inside the scroll view widget, but it is “internal workings” so you should probably leave it alone.

Oh! thank you very much as I was not aware of this.

In your code ‘scrollView’ cannot be used as a group. I think the actual group is something like scrollView._view, but the best way (read: safest, most future-proof) is to use scrollView:insert( text ), so you create the text first and then insert it into the scroll view.

Yes, there is a regular display group which you can access inside the scroll view widget, but it is “internal workings” so you should probably leave it alone.

Oh! thank you very much as I was not aware of this.