Hey everyone, this is my first post here and I am having an issue with the scrollView widget…
I am using this scrollView widget:
local scrollView = widget.newScrollView{ left = 0, top = 0, width = display.contentWidth, height = display.contentHeight, horizontalScrollDisabled = true, verticalScrollDisabled = false, }
Next, I have a lot of text objects inside the scrollView:
local textString = "Just place a bunch of text here..." local textObject = display.newText(textString,0,0,native.systemFont,14) textObject:setTextColor(0) scrollView:insert(textObject)
Now, I tried creating an anchor (functionality similar to html #) to scroll back up inside the scrollView
local function anchorTop() print("clicked anchor") --tap listener working scrollView.anchorY=0 --doesn't work end local gotoTop = display.newText("Back to Top",0,0,native.systemFont,14) gotoTop:addEventListener("tap",anchorTop)
I have tried a bunch of things, does anyone have an idea?