scrollView and background image

Dear Corona app developers,

I would like to place a background image behind scrolled text. Therefore, readers can see the beautiful background image when they read.

Unfortunately, the scrolled text always blocks me from seeing the image.

– scrollView

local lotsOfText = “TEXT. TEXT. TEXT”    

local lotsOfTextObject = display.newText(lotsOfText, 0, 0,display.contentWidth-100, 0, “Helvetica”, 40, display.contentWidth*.05)

lotsOfTextObject:setTextColor( 0,0,255 )

lotsOfTextObject:setReferencePoint( display.TopCenterReferencePoint )

lotsOfTextObject.x = display.contentCenterX

lotsOfTextObject.y = 0

scrollView:insert(lotsOfTextObject)

    

– background image

local backgroundimage = display.newImage (“background.png”)

backgroundimage.x = display.contentWidth / 2;

backgroundimage.y = display.contentHeight / 2;

    

localGroup:insert(backgroundimage)

localGroup:insert(scrollView)

Can anyone here show me how to solve this problem?

I have also tried “lotsOfTextObject.hasBackground = false

Unfortunately, it didn’t work.

Thank you in advance for your assistance.

Henry 

Dr.Henry.Chen@gmail.com

I suspect it’s in your scrollview creation code.

I presume you have a function call such as this:

local scrollView = widget.newScrollView { top = 100, left = 10, width = 300, height = 350, scrollWidth = 465, scrollHeight = 670, listener = scrollListener, }

Well just add the following to the params:

hideBackground = true --or if you wanted to change the color of the scrollview background backgroundColor = {0, 0, 0, 60}

The full list of options is here in the docs:

http://docs.coronalabs.com/api/library/widget/newScrollView.html

Hi Brother, 

You magic code works perfectly well.

Thank you so much for your help.

Warm regards,

Henry

I suspect it’s in your scrollview creation code.

I presume you have a function call such as this:

local scrollView = widget.newScrollView { top = 100, left = 10, width = 300, height = 350, scrollWidth = 465, scrollHeight = 670, listener = scrollListener, }

Well just add the following to the params:

hideBackground = true --or if you wanted to change the color of the scrollview background backgroundColor = {0, 0, 0, 60}

The full list of options is here in the docs:

http://docs.coronalabs.com/api/library/widget/newScrollView.html

Hi Brother, 

You magic code works perfectly well.

Thank you so much for your help.

Warm regards,

Henry