I’m trying to push all the entries in a vertical scroll view down, so I can insert a new item at the top. At the moment my code for doing so looks like:
[lua]
local view=scrollView:getView()
for i=1,view.numChildren do
view[i]:translate(0,newGroup.height+padding)
end
scroll:insert(newGroup)
[/lua]
However when I do this, on the first run the new group item is shunted down almost offscreen, which is weird, because I don’t understand why the scrollview’s view would have any items or why shifting them down would cause an issue.
On the second run, when there’s already a group that I’ve added in the scroll view, the scrolling above code seems to have no effect.
Am I approaching this problem from the wrong angle? Any insights into how the scrollview works, where the objects I add to it are stored would be really useful. Thanks!