ScrollView changes with V1.0.1?

Hi!

I have a vertical ScrollView which was working fine with previous versions of Cocos Creator.

scrollToBottom and scrollToTop methods didn’t worked properly, but I was able to work around this by just using scrollToPercentVertical

(I use this function to make sure the selected item is always visible…)

Today, I came back to the scene using the ScrollView, and it doesn’t work anymore! :cry:

I didn’t made any change to the code, and if I comment the call to scrollToPercentVertical, then it works again.

Did something changed in V1.0.1 related to the way (vertical) ScrollView handles its (vertical) position?


Daniel

I will check scrollview change in v1.01, please hold on…

I have checked ScrollView and the code is untouched…
maybe other parts broken ScrollView…

Thanks for having checked.

I have investigated and found what’s wrong: Y coordinates of items added to the scrollView aren’t correct on the first displayed frame!
(It is a vertical scrollView - only ‘Vertical Scroll’ is checked - content layout type is ‘Vertical’ and Resize Mode is ‘Container’)

I have displayed Y coordinates of items added to the scrollView, in lateUdpate() method and on the first frame after the items was added, the Y coordinates of all items are the same…
(for information, this Y coordinate correspond to scrollView.content.convertToWorldSpaceAR(scrollView.content.getPositionY( ) ).y )

On the second call to lateUpdate() after the items was added to the scrollView, the Y coordinates are fine.

Also, something I reported previously and which is still happening: if added items are buttons, they are ‘clickable’ even when they are not visible (they are in a content area part which is outside visible part of the scrollView)


Daniel

Something else I wanted to report: it seems that under some circumstances the behaviour of scrollToTop (or scrollToPercentVertical with 1.0) is completely wrong…

This is specially true when content height is lower than scrollView height, and content.y > scrollView.node.y : if you call scrollToTop under those conditions, then it all goes wrong (content.y is incremented instead of beeing decremented)

I’m working around this problem by setting content.y=0 instead of calling scrollToTop…is it bad?
(I set content, view and scrollView Y anchor points to 1.0, so when Y=0 it means top of scrollView)


Daniel