Forum Xamarin Xamarin.Android

How to implement pull to refresh on ListView?

I've seen many tutorials/samples for Xamarin.Forms, but none for Xamarin.Android..

Best Answer


  • KrestekKrestek USMember ✭✭

    Thanks, I've understood the axml part, but I didn't understand the weakTarget in the C# code.. I mean, we get the view, and we assign a function to the refresh event, but why is there a _swiperefresh!=null condition and a weak target variable?

  • TedRogersTedRogers USMember ✭✭✭✭
    edited November 2017

    I use this same code for layouts that might not have a swipe refresh so you can get rid of that check. You should get it working without worrying about the weak stuff. I use it just to make sure I don't have cyclic references. Not sure if it is really needed in this case.

    When I work a lot on Xamarin.iOS, I get into the habit of putting weak stuff in.

  • KrestekKrestek USMember ✭✭

    Ah okay then, it worked. Thank you!

Sign In or Register to comment.