Question

I use the following code and want to disable the navigationItems but make the tab bar still enable,but it doesn't work. both the navigation items and tab bar disable while loading data.

    HUD = [[MBProgressHUD alloc] initWithView:self.tabBarController.view];
    [self.tabBarController.view addSubview:HUD];
    HUD.labelText = NSLocalizedString(@"Loading...", nil) ;
    [HUD show:YES];

I don't know make which to be the HUD's parent view it should work.

Was it helpful?

Solution

If you have a navigation controller as the root of the tab items and only want to disable the navigation controller, add the HUD to the view of the navigation controller.

// Your controller triggering the HUD
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.navigationController.view];

OTHER TIPS

You should try adding the HUD to the main window view, or you can disable tab bar buttons by using:

[[[self tabBarController] tabBar] setUserInteractionEnabled:NO];
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top