문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top