Scroll View not wrapping words

Hello, Im using scroll view to show the instructions, when I have it set to cover the whole screen using

display.contentWidth and display.contentHeight

the text wraps around to the next line fine. I want to make the scroll view be around 40% smaller than the total screen size but when I make the scroll view smaller the text still thinks its meant to be going to the total width of the screen and does wrap around at the new size.

local scrollView = widget.newScrollView { left = display.contentWidth - 290, top = 0, width = display.contentWidth/1.3, height = display.contentHeight/3, topPadding = 380, bottomPadding = -350, horizontalScrollDisabled = true, verticalScrollDisabled = false, listener = scrollListener, } local lotsOfText = "--------------------------------------------------------\n               -- Help and Shortcuts --\n--------------------------------------------------------\n\n -- Issues --\n\n \* If no result is shown, make sure the RUN has been selected FIRST, followed by the business's name.\n\n \* If no result is shown, double check your spelling

Thanks for the help

You need to make a text object and put it in the scrollView.

https://docs.coronalabs.com/api/library/display/newText.html

That last bit of code in your post is just a variable with text in it.

Something like:

-- after code you showed local options = { text = lotsOfText, x = 0, y = 0, width = display.contentWidth/1.3, font = native.systemFont, fontSize = 18, } local myText = display.newText( options ) myText:setFillColor( 1, 0, 0 ) myText.anchorX = 0 myText.anchorY = 0 scrollView:insert( myText )

Also, you don’t want to make the scrollview taller or wider than the display.  That is wrong.

Make it the same height and width as display.

Thank you for all the help, it works a treat

You need to make a text object and put it in the scrollView.

https://docs.coronalabs.com/api/library/display/newText.html

That last bit of code in your post is just a variable with text in it.

Something like:

-- after code you showed local options = { text = lotsOfText, x = 0, y = 0, width = display.contentWidth/1.3, font = native.systemFont, fontSize = 18, } local myText = display.newText( options ) myText:setFillColor( 1, 0, 0 ) myText.anchorX = 0 myText.anchorY = 0 scrollView:insert( myText )

Also, you don’t want to make the scrollview taller or wider than the display.  That is wrong.

Make it the same height and width as display.

Thank you for all the help, it works a treat