Is there any use scrollToPercentVertical work well?
I called scrollToPercentVertical or scrollToBottom both not work. noting happen.
Is there any use scrollToPercentVertical work well?
I called scrollToPercentVertical or scrollToBottom both not work. noting happen.
No update and solution for this post??
How to scroll to a position programatically for ui::ScrollView?
In 2.0 we can use CCScrollView::setContentOffset to achieve this how to do it with ui::SrollView?
This works for me (v3.5) :
onEnter: function () {
this.scrollView = new ccui.ScrollView();
this.scrollView.setDirection(ccui.ScrollView.DIR_BOTH);
this.scrollView.setTouchEnabled(true);
this.scrollView.setBounceEnabled(false);
this.scrollView.setContentSize(cc.winSize);
this.scrollView.setAnchorPoint(cc.p(0.5, 0.5));
this.scrollView.setPosition(ds.view.centerOfView());
this.scrollView.setInertiaScrollEnabled(true);
this.addChild(this.scrollView);
this.bg = new cc.Sprite(res.map.bg);
this.bg.setPosition(1024, 1024);
this.scrollView.addChild(this.bg);
this.scrollView.setInnerContainerSize(cc.size(2048, 2048));
this._super(); //<---------------------- IMPORTANT BEFORE JUMP
this.scrollView.jumpToPercentBothDirection(cc.p(50, 50));