Search code examples
iosxamarin.formsprogressdialog

Xamarin Forms: Userdialogs showloading is not working in ios


I am using Acr.UserDialogs Nuget Package for showing the loading progress in my projects. It is working fine on android and windows, but not showing on IOS. I am using the following line of code for the progress dialog:

UserDialogs.Instance.ShowLoading("");

Version Details:

Acr.UserDialogs: 7.0.26
Xamarin forms: 4.6.0.726

Not added any initialization code on ios because it is optional.

For post services, the ShowLoading is working. But for the get services, there is no loading showing on the UI. I will add a sample project for the reference.


Solution

  • The latest version of the plugin is 7.1.x . You could firstly update the plugin and XF both in Forms and platform projects .

    In addition , it would be better to invoke the method in UI thread if the line is in a child tasking .

    Device.BeginInvokeOnMainThread(()=> { 
                
       //...
                
    });
    

    Update

    In your sample , you invoke the line in constructor . Actually , it is not a good design . As in constructor the page hasn't finished loading yet . You could invoke the line in OnAppearing (you could set a property like isFirstLoad to let the dialog display one time )