roubachof / Sharpnado.CollectionView

A performant list view supporting: grid, horizontal and vertical layout, drag and drop, and reveal animations.
The Unlicense
244 stars 30 forks source link

I can't find the ScrollTo api #51

Closed KazysNoobiys closed 2 years ago

KazysNoobiys commented 2 years ago

This is a great library, a lot of functionality. But it seems to have no ScrollTo method, and that's very weird! Is it possible to add this method?

KazysNoobiys commented 2 years ago

I figured out how to organize scrolling. It is necessary to change the CurrentIndex. I want to note that this is not an intuitive api. It would be great to add ScrollTo method for more similarity with classic CollectionView. Also unfortunately there is no scroll animation, it's very sad.

roubachof commented 2 years ago

you can ease your sadness by providing a PR 😅

roubachof commented 2 years ago

just added a scrollTo method:

    public bool AnimateScroll { get; set; }

    public void ScrollTo(int index, bool animateScroll = true)
    {
        AnimateScroll = animateScroll;
        CurrentIndex = index;
    }

I'm not sure scroll animation will work on android though