I have a buttono in the navigation item which action is BUTTON_ACTION. By pressing it, MBProgressHUD is activate and the action work. but the "dimBackground" that make "hidden" the scrren, doe not work on the navigationbar, and the button can be pressed again during the MBProgressHUD. The code is:
HUD = [[MBProgressHUD alloc] initWithView:self.view];
[self.view addSubview:HUD];
// Regiser for HUD callbacks so we can remove it from the window at the right time
HUD.delegate = self;
HUD.labelText=@"Buscando Bares...";
HUD.dimBackground = YES;
// Show the HUD while the provided method executes in a new thread
[HUD showWhileExecuting:@selector(BUTTON_ACTION) onTarget:self withObject:nil animated:YES];
I tryed to use:
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
[self.navigationController.view addSubview:HUD];
Any idea about that? thanks in advance.
To make the MBProgressHUD being displayed above all UI controls including the UINavigationBar you must do this:
HUD = [[MBProgressHUD alloc] initWithWindow:self.view.window];
[self.view.window addSubview:HUD];