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?