barmalei / zebkit

JavaScript library that follows easy OOP concept, provides HTML5 Canvas based Rich UI and includes Java to JavaScript converter tool
Apache License 2.0
931 stars 177 forks source link

scrollpan cannot scroll in zebkit-next-generation #82

Open jfojfo opened 8 years ago

jfojfo commented 8 years ago

scrollpan is unscrollable!

I have fixed this problem in my own fork https://github.com/jfojfo/zebra,

see https://github.com/jfojfo/zebra/commit/18d60ae467f4b16ddfa3c489c77d11050f46f243

jfojfo commented 8 years ago

also add support of match parent size for scrollpan's scroll content,

just add STRETCH constraints for content, the following sample will set width of scroll content to its parent's width

eg:

    var container = new Panel({
        id: 'list',
        layout: new ListLayout(10),
        constraints: STRETCH,
        kids: arr
    });
    var vscroll = new ScrollPan(container, 'vertical', true);

see detail patch here: https://github.com/jfojfo/zebra/commit/98ba0da9651070ce827f1aa286d66d597159ffcb