我在导航项中有一个按钮,它的动作是 BUTTON_ACTION。通过按下它,MBProgressHUD 被激活并且动作起作用。但是使屏幕“隐藏”的“dimBackground”在导航栏上不起作用,并且可以在 MBProgressHUD 期间再次按下该按钮。代码是:
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];
我尝试使用:
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
[self.navigationController.view addSubview:HUD];
有什么想法吗?提前致谢。