setchi/FancyScrollView

Refill the scrollview with new content

yzaroui opened this issue · 1 comments

Hello,

My scrollview holds levels for a given world of the game.
When I select a new world I would like to repopulate the scrollview with the new world levels.

I created this method

    public void UpdateCellData()
    {
        var cellData = WorldManager.Instance.Levels
            .Select(kvp => new WorldLevelCellData()
            {
                LevelNumber = kvp.Key,
                LevelData = kvp.Value,
                Active = kvp.Value.Active || kvp.Key == 0
            })
            .ToList();

        scrollView.UpdateData(cellData);
    }

that is called when I select a level.
This does not immediately update the scrollview, but I have to scroll through the levels to see the cells update.

Any fix for this?

Sorry, it just works :)