Images In A Scrollview Not Centering

I’m having trouble getting images to center in the new scrollview widget.  They are close, but slightly off center.  This is in build 1054.  I attached the code, and also a screenshot of what’s happening.  You can tell the red bar is CLOSE to be centered, but slightly off.  If I remove the line where it inserts into the scrollView then it centers perfectly.  Any ideas?

 

 scrollView = widget.newScrollView { left = screenLeft, top = 0, width = screenWidth-24, height = screenHeight, scrollWidth = screenWidth-24, scrollHeight = 1000, id = "onBottom", horizontalScrollingDisabled = true, verticalScrollingDisabled = false, hideBackground = false, hideScrollBar = true, listener = scrollListener, } group:insert(scrollView) local rowBG = display.newImageRect( "assets/tabbar.png", 150, 210 ) rowBG:setReferencePoint( display.CenterReferencePoint ) rowBG.y = scrollView.y rowBG.x = screenMiddleX scrollView:insert( rowBG ) 

 

 

I see you are specifying a custom size for your scrollView but you are not providing the required mask file.  Perhaps that is the cause.  I also can’t tell the value of screenLeft from your code sample.  If it has any value it would push the whole scrollView right by that many pixels which would also off center your content.

Thanks for the response Rob, I set the width equal to the entire screen width and the problem is fixed.

I see you are specifying a custom size for your scrollView but you are not providing the required mask file.  Perhaps that is the cause.  I also can’t tell the value of screenLeft from your code sample.  If it has any value it would push the whole scrollView right by that many pixels which would also off center your content.

Thanks for the response Rob, I set the width equal to the entire screen width and the problem is fixed.