A problem with scrollview

A problem with scrollview
0.0 0


Recently I am trying to make a scroll view screen using CocosBuilder and cocos2dx,
Everything works fine, except the scroll view part.


This is what I want to achieve,
I have a 500 * 420 scroll view,
it contains a small node which content size is set to 500 * 130 as default,
the node has only one icon stayed at the left bottom side.

Each time I click the “Add Icon” Button,
one new icon shall be added to the node, line up to the right side of the previous one.
when it reaches the limit of the node (as well as the scroll view),
the icon is added to the upper of the first icon,
and the node’s content sizeY will add the height of the icon,
being expanded to be a bigger node.

for example:


add an icon:

add five icons:

add six icons:

(and this time, the node (the container) should do this(containerNode~~>getContenxrSize.y + icon~~>getContentSize.y))

and go on like this.


So my problem is,
the scroll view messed up with the reason I don’t know.
At first, the first icon should stay at the left bottom, and no matter how I drag the scroll view, it shouldn’t move.
But, when I just start ccTouchBegan or ccTouchMoved, the icon runs to the left upper side and keeps staying there. It won’t come back to left bottom any more.
And I drag the scroll view again, the icon just suddenly fly to the middle of the scroll view like I have fully dragged the view to its limit with the bounce function. When I stop touching, the icon smoothly went back to the left upper side…

Sorry it seems a little hard to explain,
maybe it’s because my poor English.
yet still I hope anyone can help me.

Thank you so much in advance.