Search code examples
c#iosxamarin.iosxamarinmbprogresshud

Progress indicator not bring to front view


ProgressIndicator (MTMProgressHub) when bring to Front its not appears

    hud = new MTMBProgressHUD (View);
    View.BringSubviewToFront (hud);
    View.AddSubview (hud);
    hud.Show (true);

Please find the below Imageenter image description here

As showing in image the progress indicator is back side of buttons (Registration Login Contact Us)..

    public LoginViewController(){

        hud = new MTMBProgressHUD (View);
        View.BringSubviewToFront (hud);
        View.AddSubview (hud);
        hud.Show (true);

}

unable to push it to front.


Solution

  • You can bring a view to front only when it is added to a parent view. Here you called BringSubviewToFront before adding it to the view.

    Change that to:

    hud = new MTMBProgressHUD (View);
    View.AddSubview (hud);
    View.BringSubviewToFront (hud);
    hud.Show (true);