Pageview features

Pageview features
0.0 0


Hi, the default pageview is cool, but it’s missing a couple features, or at least I can’t find them…
Is there any way to make it loop, so that when you scroll past the last page you get back to the first one (and the other way round)?
Can I make the indicator clickable, to make it go directly to the clicked page?
Can I add navigator buttons (prev/next page)? Dragging is cool on mobile, but not so intuitive from PC, so I would like to be able to do both.

Of course I can do all these things with code, but I would like to know if there is any preset option to make these easily, so I don’t waste time implementing something that already exists, but I can’t find in the docs.



Very good features if add in Cocos2d-x and Cocos Creator and C++ plugin (PageView not work in C++ plugin)


For now I added 2 buttons that call these function on click

onNextPage: function () {
var pView = this.node.getComponent(cc.PageView);
pView.setCurrentPageIndex((pView.getCurrentPageIndex()+1)% pView.getPages().length);
onPrevPage: function () {
var pView = this.node.getComponent(cc.PageView);
pView.setCurrentPageIndex((pView.getPages().length+pView.getCurrentPageIndex()-1)% pView.getPages().length);

it works fine, but it would be nice to have more features with the next releases (in particular to make it loop when dragging past the last page)