The 0,0 of the scrollview

Here’s a thing… You will get two dots at different location with this code. Why? I don’t know. Seems like both dots should be at the top left. Can anyone tell me why this happens?

local widget = require("widget") local circleA = display.newCircle( 0, 0, 50 ) local circleB = display.newCircle( 0, 0, 50 ) circleA.fill = {1,0,0} circleB.fill = {0,1,0} local scrollViewA = widget.newScrollView{ top = 0, left = 0, width = display.actualContentWidth, height = display.actualContentHeight, hideBackground = true, } scrollViewA:getView():insert( circleA ) local scrollViewB = widget.newScrollView{ top = 0, left = 0, width = display.actualContentWidth, height = display.actualContentHeight, hideBackground = true, } scrollViewB:insert( circleB )

Interesting discovery. But my first question is why do you call getView() instead of using the scrollView’s own insert() function? you have to have a reference to the SV to call getView(). Seems like a bit of a redundant method. What is your use case for needing getView()?

Rob

Interesting discovery. But my first question is why do you call getView() instead of using the scrollView’s own insert() function? you have to have a reference to the SV to call getView(). Seems like a bit of a redundant method. What is your use case for needing getView()?

Rob