ScrollView White Background When Scrolling Too Far Up or Down

local function scrollListener( event ) local phase = event.phase if ( phase == "began" ) then print( "Scroll view was touched" ) elseif ( phase == "moved" ) then print( "Scroll view was moved" ) elseif ( phase == "ended" ) then print( "Scroll view was released" ) end -- In the event a scroll limit is reached... if ( event.limitReached ) then if ( event.direction == "up" ) then print( "Reached bottom limit" ) elseif ( event.direction == "down" ) then print( "Reached top limit" ) elseif ( event.direction == "left" ) then print( "Reached right limit" ) elseif ( event.direction == "right" ) then print( "Reached left limit" ) end end return true end local dataGroup={} -- Create the widget local scrollView = widget.newScrollView( { top = 0, left = 0, width = W, height = H, scrollWidth = W, scrollHeight = H, listener = scrollListener, horizontalScrollDisabled = true }) local scrollViewBackground = display.newRect( W/2,56\*numItems/2,W,56\*numItems ) scrollViewBackground:setFillColor( 0, 0.5, 0.9 ) scrollView:insert( scrollViewBackground ) for i = 1, numItems, 1 do dataGroup[i] = display.newCircle( 56, 50 \* i, 22 ) dataGroup[i]:setFillColor( math.random(), math.random(), math.random() ) scrollView:insert(dataGroup[i] ) end

This is the code I am using for a scroll view. How do I get rid of the ugly white background that shows up when I scroll too far up or down?

This is likely the background color of your app (behind the scrollview).  Have you tried changing the bg color?

It also might be the background of the scrollview, which is white by default. There is an API to hide it.

Okay, I see now that the scrollView has a backgroundColor field that I can change which fixes the white background issue. However, is there a way to, say, keep the topmost element from being pulled any lower than its original position? (i.e. don’t let the scrollview scroll past where I have placed things in it?)

Try scrollView.isBounceEnabled = false

This is likely the background color of your app (behind the scrollview).  Have you tried changing the bg color?

It also might be the background of the scrollview, which is white by default. There is an API to hide it.

Okay, I see now that the scrollView has a backgroundColor field that I can change which fixes the white background issue. However, is there a way to, say, keep the topmost element from being pulled any lower than its original position? (i.e. don’t let the scrollview scroll past where I have placed things in it?)

Try scrollView.isBounceEnabled = false