Working with large text boxes!

Hello,

I’m developing an app that is basically like a book. Inside a scene which will be a scroll view scene there will be a lot of photos that each photo will have a description inside a smaller scroll view that contains a large texts. I am a bit new with programming in lua and corona and I have encountered a problem with the texts blocks. In some devices after build, the texts in some scrollview boxes would not show. I have seen the tutorial of the following link: https://coronalabs.com/blog/2014/06/17/tutorial-working-with-large-blocks-of-text/ and my question is how to deal with more than one large texts inside a scene like in my case. The following code is one of my scenes codes. Tips, advices would be welcomed and appreciate.

-- Function to handle button events ----------------------------------------------------------------------------------------- -- -- randomscene.lua -- ----------------------------------------------------------------------------------------- local composer = require( "composer" ) local scene = composer.newScene() local widget = require("widget") -------------------------------------------- -- forward declaration local background local backGroup local mainGroup local uiGroup local backbutton local infobt local swiperight = 300 -- amount of pixels finger must travel to initiate page swipe local swipeleft = -300 local function onPageSwipe( self, event ) local phase = event.phase if phase == "began" then display.getCurrentStage():setFocus( self ) self.isFocus = true elseif self.isFocus then if phase == "ended" or phase == "cancelled" then local distance = event.x - event.xStart if distance \> swiperight then -- SWIPED to right; go back to title page scene composer.gotoScene( "Eng.engAnatomy", "slideRight", 800 ) end display.getCurrentStage():setFocus( nil ) self.isFocus = nil end end return true end local function handleButtonEvent( event ) if ( "ended" == event.phase ) then print( "Button was pressed and released" ) end return true end local function goback( event ) if ( "ended" == event.phase ) then composer.gotoScene( "Eng.engAnatomy", "slideRight", 800 ) end return true end 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" ) end end return true end function scene:create( event ) local sceneGroup = self.view -- Called when the scene's view does not exist. -- -- INSERT code here to initialize the scene -- e.g. add display objects to 'sceneGroup', add touch listeners, etc. backGroup = display.newGroup() sceneGroup:insert(backGroup) mainGroup = display.newGroup() sceneGroup:insert(mainGroup) uiGroup = display.newGroup() sceneGroup:insert(uiGroup) -- display a background image background = display.newImageRect( backGroup, "background.png", display.contentWidth, display.contentHeight ) background.anchorX = 0 background.anchorY = 0 background.x, background.y = 0, 0 local icon = display.newImageRect( mainGroup, "Image.png", 130, 400 ) --image.anchorX = 0 --image.anchorY = 0 icon.x = display.contentCenterX icon.y = 220 local scrollView = widget.newScrollView( { top = 0, left = 0, width = display.contentWidth, height = display.contentHeight, --scrollWidth = 1080, --scrollHeight = 4000, topPadding = 50, bottomPadding = 80, listener = scrollListener, horizontalScrollDisabled = true, hideBackground =true }) local scrollViewInside = widget.newScrollView( { --bottom = 300, top = 1100, left = 120, width = 840, height = 700, --scrollWidth = 400, --scrollHeight = 400, topPadding = 5, bottomPadding = 5, listener = scrollListener, horizontalScrollDisabled = true, hideBackground =true } ) local scrollViewInside2 = widget.newScrollView( { --bottom = 300, top = 2600, left = 120, width = 840, height = 700, --scrollWidth = 400, --scrollHeight = 400, topPadding = 5, bottomPadding = 5, listener = scrollListener, horizontalScrollDisabled = true, hideBackground =true } ) local scrollViewInside3 = widget.newScrollView( { --bottom = 300, top = 4100, left = 120, width = 840, height = 700, --scrollWidth = 400, --scrollHeight = 400, topPadding = 5, bottomPadding = 5, listener = scrollListener, horizontalScrollDisabled = true, hideBackground =true } ) local titleoptions1 = { text = "Random text.?", font = "Helvetica Neue/HelveticaNeue-Bold.otf", fontSize = 53, width = 900, height = 0, align = "center" } local titleoptions2 = { text = "Random text.", font = "Helvetica Neue/HelveticaNeue-Bold.otf", fontSize = 53, width = 900, height = 0, align = "center" } tittle1 = display.newText( titleoptions1 ) tittle1.x = display.contentCenterX tittle1.y = 1000 tittle2 = display.newText( titleoptions2 ) tittle2.x = display.contentCenterX tittle2.y = 2500 tittle3 = display.newText( mainGroup,"Random text.", 0, 0, "Helvetica Neue/HelveticaNeue-Bold.otf", 55 ) tittle3.x = display.contentCenterX tittle3.y = 4000 local options = { text =[[Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. and so on...]], --x = display.contentCenterX, --y = display.contentCenterY, fontSize = 50, width = 840, height = 0, align = "center" } local options2 = { text =[[Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. and so on...]], --x = display.contentCenterX, --y = display.contentCenterY, fontSize = 50, width = 840, height = 0, align = "center" } local options3 = { text =[[Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text.Random text. and so on...]], --x = display.contentCenterX, --y = display.contentCenterY, fontSize = 50, width = 840, height = 0, align = "center" } local textobject = display.newText( options ) textobject.anchorX = 0 textobject.anchorY = 0 textobject.x = 0 local textobject2 = display.newText( options2 ) textobject2.anchorX = 0 textobject2.anchorY = 0 textobject2.x = 0 local textobject3 = display.newText( options3 ) textobject3.anchorX = 0 textobject3.anchorY = 0 textobject3.x = 0 local image = display.newImageRect( mainGroup, "Images/TBU.png", 1080, 507 ) --image.anchorX = 0 --image.anchorY = 0 image.x = display.contentCenterX image.y = 700 local image2 = display.newImageRect( mainGroup, "Images/TBU2.png", 1080, 507 ) --image.anchorX = 0 --image.anchorY = 0 image2.x = display.contentCenterX image2.y = 2200 local image3 = display.newImageRect( mainGroup, "Images/TBU.png", 1080, 507 ) --image.anchorX = 0 --image.anchorY = 0 image3.x = display.contentCenterX image3.y = 3700 -- Center the button backbutton = display.newImageRect( uiGroup, "Icons/Backbutton.png", 68, 62 ) backbutton.x, backbutton.y = 95 , 147 infobt = display.newImageRect( uiGroup, "Icons/Info.png", 73, 68 ) infobt.x, infobt.y = 985 , 147 -- the following are the scrollview image outside the real scrollview scrollbox = display.newImageRect( mainGroup, "TextBox.png", 930, 790 ) --scrollbox.anchorX = 0 --scrollbox.anchorY = 0 scrollbox.x = display.contentCenterX scrollbox.y = 1450 scrollbox2 = display.newImageRect( mainGroup, "TextBox.png", 930, 790 ) --scrollbox.anchorX = 0 --scrollbox.anchorY = 0 scrollbox2.x = display.contentCenterX scrollbox2.y = 2950 scrollbox3 = display.newImageRect( mainGroup, "TextBox.png", 930, 790 ) --scrollbox.anchorX = 0 --scrollbox.anchorY = 0 scrollbox3.x = display.contentCenterX scrollbox3.y = 4450 -- all display objects must be inserted into group uiGroup:insert( backbutton ) uiGroup:insert( infobt ) mainGroup:insert( icon ) mainGroup:insert( scrollbox ) mainGroup:insert( tittle1 ) mainGroup:insert( tittle2 ) mainGroup:insert( tittle3 ) mainGroup:insert( scrollView ) mainGroup:insert( scrollViewInside ) mainGroup:insert( scrollViewInside2 ) mainGroup:insert( scrollViewInside3 ) scrollView:insert( icon ) scrollView:insert( tittle1 ) scrollView:insert( tittle2 ) scrollView:insert( tittle3 ) scrollView:insert( scrollbox ) scrollView:insert( scrollbox2 ) scrollView:insert( scrollbox3 ) scrollView:insert( image ) scrollView:insert( image2 ) scrollView:insert( image3 ) scrollView:insert( scrollViewInside ) scrollView:insert( scrollViewInside2 ) scrollView:insert( scrollViewInside3 ) scrollViewInside:insert( textobject ) scrollViewInside2:insert( textobject2 ) scrollViewInside3:insert( textobject3 ) end function scene:show( event ) local sceneGroup = self.view local phase = event.phase if phase == "will" then -- Called when the scene is still off screen and is about to move on screen elseif phase == "did" then -- Called when the scene is now on screen -- -- INSERT code here to make the scene come alive -- e.g. start timers, begin animation, play audio, etc. background.touch = onPageSwipe background:addEventListener( "touch", background ) backbutton:addEventListener( "touch", goback ) end end function scene:hide( event ) local sceneGroup = self.view local phase = event.phase if event.phase == "will" then -- Called when the scene is on screen and is about to move off screen -- -- INSERT code here to pause the scene -- e.g. stop timers, stop animation, unload sounds, etc.) -- remove event listener from background background:removeEventListener( "touch", background ) backbutton:removeEventListener( "touch", goback ) elseif phase == "did" then -- Called when the scene is now off screen end end function scene:destroy( event ) local sceneGroup = self.view -- Called prior to the removal of scene's "view" (sceneGroup) -- -- INSERT code here to cleanup the scene -- e.g. remove display objects, remove touch listeners, save state, etc. end --------------------------------------------------------------------------------- -- Listener setup scene:addEventListener( "create", scene ) scene:addEventListener( "show", scene ) scene:addEventListener( "hide", scene ) scene:addEventListener( "destroy", scene ) ----------------------------------------------------------------------------------------- return scene

Thank you in advance!

Arnold.