Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

Trouble with ActivityIndicator

$
0
0

Hi,

I have a simple scenario: a search button is clicked, an ActivityIndicator is shown, a REST call executed, the spinner is hidden.
I verified that the indicator is displayed correctly in my XAML layout. However, the indicator is not showing when I press the search button - I assume the UI is not updated until the REST call is completed so the spinner is basically shown/hidden at once.

I'm trying to find a way around this by calling the show activity indicator asynchronously (below) but that doesn't work either.

Any ideas?

Thanks!

var task = Task.Run(async () =>
            {

                ActivityIndicator spinner = this.FindByName<ActivityIndicator>("activityIndicator");
                spinner.IsVisible = true;
                spinner.IsRunning = true;
            });
task.Wait();

Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>