Xamarin.Forms custom loading gif as activity indicator

user1667474 picture user1667474 · Sep 12, 2014 · Viewed 11.9k times · Source

I would just like to know of something is possible as I am very new to Xamarin and I am on a time limit for an assignment. I don't mind some trial and error, but don't want to waste the time if it isn't possible

I want to have an animated gif as an activity indicator (it is a logo).

I have it working in a WebView - is it possible, in Xamarin,Forms to have this appear as an overlay while waiting on long running methods?

For example. if user clicks on a button, the app gets some info from a webservice then displays in a page. While waiting I would like to show the webview (or any other way to show an animagted gif).

So I am not asking for the code, but just if it is posible.

Thanks in advance

Answer

user1667474 picture user1667474 · Sep 17, 2014

I was able to work this out

With the animated(loading) gif running in the WebView page I called a couple of async methods using following

await Task.WhenAll(method1(), method2());
await Navigate.PushAsync(new NextPage(var1, var2));

The laoding gif (which is an animated logo) runs until the tasks are complete then navigates to the next page