I am in the processes of making an iOS port of my game. On the android version, I use a scrollview to display the game’s instructions. It looks something like this:
local scrollView = widget.newScrollView({ x = display.contentCenterX, y = display.contentCenterY, width = display.actualContentWidth, height = display.actualContentHeight, scrollWidth = display.actualContentWidth, scrollHeight = display.actualContentHeight, horizontalScrollDisabled = true, isBounceEnabled = false, backgroundColor = gameSettings.background, }) loadText() --creates variable howToText after reading the file local options = { text = howToText, x = display.contentCenterX, y = display.actualContentHeight, width = display.actualContentWidth - (display.actualContentWidth / 10), font = gameSettings.defaultFont, fontSize = 25, align = "left", -- Alignment parameter } local myText = display.newText( options ) myText.y = myText.height / 2 myText.fill = gameSettings.buttonStroke scrollView:insert(myText) sceneGroup:insert(scrollView)
On Android, this works fine. However, on iOS it cuts off the bottom of the text (on the iPhone simulator, it only cuts off the last line or two, but on iPad it cuts out about half of it). On iPad it also removes the margin I had created using the text’s width property. Is there a way to increase the scroll height? I tried
scrollView:setScrollHeight(myText.height)
to no avail. Any thoughts? Thanks in advance for your help!