Thanks. That fixed the problem and I can scroll trough all of the fonts in the simulator. When I run on my Android it only lets me scroll through the first few. The scroll bar on the right is all the way down to the button but I can tell there are more font names in the scrollView. What would be stopping the scroll?
Below is my code:
local grpFont = display.newGroup() grpFont.isVisible = true local function scrollListener( event ) local phase = event.phase local direction = event.direction local obj = event.target -- local reference to button if "began" == phase then obj.timer = system.getTimer() --print( "Began" ) elseif "moved" == phase then --print( "Moved" ) elseif "ended" == phase then local t = system.getTimer() -- get the current time local df = t - obj.timer -- calc time the finger was held down if df \> 1000 then -- if finger held on object for more than a second -- DO SOMETHING local alert = native.showAlert( "Corona", "Dream. Build. Ship.", { "OK", "Learn More" }) end end -- If we have reached one of the scrollViews limits if event.limitReached then if "up" == direction then --print( "Reached Top Limit" ) elseif "down" == direction then --print( "Reached Bottom Limit" ) elseif "left" == direction then --print( "Reached Left Limit" ) elseif "right" == direction then --print( "Reached Right Limit" ) end end return true end local scrollView -- Touch event listener for background image local function onSceneTouch( event ) print( "onSceneTouch ", event.phase ) print( imgHome.ready ) if event.phase == "ended" then elseif event.phase == "moved" then -- Check if you moved your finger while touching local dx = math.abs( event.x - event.xStart ) -- Get the x-transition of the touch-input local dy = math.abs( event.y - event.yStart ) -- Get the y-transition of the touch-input if dx \> 5 or dy \> 5 then scrollView:takeFocus( event ) -- If the x- or y-transition is more than 5 put the focus to your scrollview end end return true end scrollView = widget.newScrollView{ top = 120, left = 10, width = 400, height = 200, scrollWidth = 400, scrollHeight = 800, maskFile = "images/maskfont.png", listener = scrollListener } scrollView:setReferencePoint(display.TopLeftReferencePoint) local y2 = 100 local fonts = native.getFontNames() local count, found\_count = 0, 0 for i,fontname in ipairs(fonts) do print("found font: " .. fontname) local obj = display.newText(fontname, 0, 0, fontname, 24) obj:setReferencePoint(display.TopLeftReferencePoint) obj:setTextColor(0, 0, 0) y2 = y2 + 30 obj.x = 5 obj.y = y2 scrollView:insert(obj) end grpFont:insert(scrollView)