Frage

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.

War es hilfreich?

Lösung

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

Andere Tipps

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];
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top