how to use ccs.ScrollView

var scroll = ccs.ScrollView.create();
scroll.setInnerContainerSize(cc.SizeMake(100, 100));
this.addChild(scroll);
var bgSprite = cc.Sprite.create(s_bg);
scroll.addChild(bgSprite);

Sprite can’t show.
Please give me an example

Hi, I’ve posted about this problem (and even created a support issue) too: the examples given in the samples/tests directory are difficult to understand, so I can’t help you with this.

In my case, I ended up creating a Layer and implementing my own scroll (and zoom) methods for it. It’s really an easier logic than one might think, so if you don’t have a particular need to use CCSScrollView, I advice you try to implement the logic yourself.

Hi,ying1248.
This a example about scrollView. But i suggest you create a ccs.ScrollView with cocostudio edtor.

        var scrollView = ccs.ScrollView.create();
        scrollView.setDirection(ccs.ScrollViewDir.vertical);
        scrollView.setSize(cc.size(200, 100));
        scrollView.setInnerContainerSize(cc.size(220,120));
        scrollView.setPosition(cc.p(400,200));

        var imageView = ccs.ImageView.create();
        imageView.loadTexture("res/DefaultBone.png");
        scrollView.addChild(imageView);
        
        var uiLayer = ccs.UILayer.create();
        uiLayer.addWidget(scrollView);
        this.addChild(uiLayer);

Yeah, but, there are cases in which going to CocoStudio is overkill: all we want is to empower some sprite or layer with the ability to be scrolled and contained in an area. And with just that code snippet alone (which is fairly simmilar to the one in the test cases), with no comments on what line of code does what (specially in the sizes and positions settings) I just can’t seem to make it behave just right (for example: I get my image to show, but I can’t scroll it, or I can only scroll it a little bit in one direction).

I know you are probably used to this code and think it’s obvious, but would you mind explaining it a bit?

Thanks

Thank you for your help!

Please help me to scroll the view pagewise…
thanks in advance…