Pregunta

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.

¿Fue útil?

Solución

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];

Otros consejos

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];
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top