Forum Xamarin Xamarin.Forms

Refreshing Listview

ABloxityABloxity Member ✭✭✭

How can I make the listview soda appear first and then the List is loaded?

This is my code.

And this my result

Answers

  • JarvanJarvan Member, Xamarin Team Xamurai

    make the listview soda appear first and then the List is loaded

    What's the soda, could you post more details about that?

    If you mean to pull To refresh the ListView. Here is a tutorial you can refer to.
    https://xamarinhelp.com/pull-to-refresh-listview/

  • MarcDietersMarcDieters USMember ✭✭

    I think what he means is that a loader should be shown while the data is loading.

    If that's the case, see my answer here:
    https://forums.xamarin.com/discussion/comment/398104#Comment_398104

  • ABloxityABloxity Member ✭✭✭

    Exactly, I want the charger to be displayed first while the list is loading.

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited December 2019

    Exactly, I want the charger to be displayed first while the list is loading.

    Do you mean display the refreshing icon first? Try to set the ListView's ItemsSource to null and reset the value after refershing data.

    public ICommand RefreshCommand
    {
        get {
            return new Command(async () =>
            {
               //set the itemsSource to null
    
                IsRefreshing = true;
    
                await RefreshData();
    
                IsRefreshing = false;
            });
        }
    }
    
Sign In or Register to comment.