小编dox*_*xsi的帖子

MBProgressHud不适用于导航栏

我在导航项中有一个buttono,其动作是BUTTON_ACTION.通过按下它,MBProgressHUD被激活并且动作有效.但是"dimBackground"使scrren"隐藏",在导航栏上不起作用,并且可以在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];
Run Code Online (Sandbox Code Playgroud)

我试着用:

HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
        [self.navigationController.view addSubview:HUD];
Run Code Online (Sandbox Code Playgroud)

有什么想法吗?提前致谢.

objective-c mbprogresshud

8
推荐指数
1
解决办法
1906
查看次数

如何使用两个后续的MBProgressHUD消息

我想在通过NSURL字符串上传期间使用MBProgressHUD显示消息.所以我编码:

MBProgressHUD *hud1 = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 
hud1.labelText = @"sending info ..."; 
hud1.minShowTime =10.0;

NSURL *url =[NSURL URLWithString:self.urlToUpload];
Run Code Online (Sandbox Code Playgroud)

10秒的时间是为了等待一段时间我希望用户等待.它有效,但是当第一个消失时我会显示另一条消息.使用另一个:

MBProgressHUD *hud2 = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 
hud2.labelText = @"SENT!"; 
hud2.minShowTime =2.0;
Run Code Online (Sandbox Code Playgroud)

它没用,因为这条消息与第一条消息重叠.有关于此的任何提示?

iphone mbprogresshud

2
推荐指数
1
解决办法
2342
查看次数

标签 统计

mbprogresshud ×2

iphone ×1

objective-c ×1