Hello Everyone,
I am facing a problem with newScrollView. Actually I’ve a huge amount of text and I’m using scroll view. It’s working fine if the text is not quite long enough but it fails when the text is huge.
Here is my code
local getText local options = { text = "", x = 0, y = 0, font = "OpenSans-Regular.ttf", fontSize = 24, width = display.contentWidth - 15, height = 0, align = "left" } local function scrollListener( event ) if ( event.limitReached ) then if ( event.direction == "left" ) then nextSceneFunc() elseif ( event.direction == "right" ) then prevSceneFunc() end end return true end local scrollView = widget.newScrollView( { top = 180, left = 3, width = display.contentWidth + 4, height = display.contentHeight - 178, topPadding = 10, bottomPadding = 10, horizontalScrollDisabled = false, verticalScrollDisabled = false, hideBackground = true, listener = scrollListener } ) local function displayText() getText = display.newText(options) getText:setTextColor(0, 0, 0) getText.text = "a lot of text here" getText.anchorY = 0 scrollView:insert(getText) end function main() displayText(); end main()
I have also attached a screenshot.
Any help would be highly appreciated.
Thanks,