Alright, I loaded up the Widget Demo sample and changed the background element to be tall enough to actually scroll (changed the height from 512 to 5120) and on my iPhone 6 it is not very good. Fast swipes and such are totally missed, it’s really hard to scroll any distance at a time. That said, even though the sample feels bad to use, it is rendering smoothly.
As per my own app, I have a scrollview with ~100 button widgets inside of it. The scrollview is defined like this:
levelSelectGroup = widget.newScrollView({ left = 0, top = titleBarHeight, width = display.contentWidth, height = display.contentHeight - titleBarHeight, scrollWidth = display.contentWidth, horizontalScrollDisabled = true, hideBackground = true })
and I have a loop that generates button widgets and inserts them like this:
buttons[id] = widget.newButton({ label = tostring( puzzleData.index ), id = id, left = xOffset, top = yOffset, onEvent = handleLevelSelect, emboss = false, width = buttonWidth, height = levelButtonHeight, font = native.systemFont, fontSize = primaryFontSize, labelAlign = "center", labelColor = { default={ 89/255, 97/255, 86/255 }, over={ 160/255, 177/255, 86/255 } } }) -- add to the scrollView levelSelectGroup:insert(buttons[id])
The performance is bad on my iPhone 6. All my current data has 100 buttons (or less) per scrollview, only one scrollview in view at a time and the performance is really sluggish, it’s visibly lagging, the rendering looks like it’s stuttering. Any ideas? I verified that I don’t have button events firing during scroll or anything like that.