Skip to content
This repository has been archived by the owner on Dec 2, 2021. It is now read-only.

Use famous-sizeconstraint with FlexScrollView #131

Open
nightshadecf opened this issue Apr 17, 2016 · 0 comments
Open

Use famous-sizeconstraint with FlexScrollView #131

nightshadecf opened this issue Apr 17, 2016 · 0 comments

Comments

@nightshadecf
Copy link

This specific code does apply the constraint, however scrollview doesn't flow items correctly, all items are laid out on top like the position of the first. I'm using a default FlexScrollView with listlayout. Any idea on how to implement this correctly? (I tried to wrap sizeconstraint in a RenderNode but it doesn't work either)

var scrollView = new FlexScrollView({
        autoPipeEvents: true,
        useContainer: true,
        flow: true
});
function _createSection(i) {
        var section = new Surface({
            size: [undefined, true],
            content: "Panel " + i,
            properties: {
                color: "hsl(" + ("" + i) + ", 50%, 70%)",
                fontSize: Math.round(0.5 * height) + "px",
                backgroundColor: "hsla(" + ("" + i) + ", 50%, 50%, 0.8)",
                'white-space': 'nowrap',
            }
        });
        section.pipe(scrollView);
        var sizeConstraint = new SizeConstraint({
            scale: [0.5, undefined]
        });
        sizeConstraint.add(section);
        return sizeConstraint;
}
for (var i = 0; i < 100; i++) {
    var section = _createSection(i);
    scrollView.push(section);
}

Screen shot here:
screen shot 2016-04-18 at 12 52 35 am

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant