如何在iOS中显示MBProgressHud时添加文本?

时间:2016-02-17 07:38:44

标签: ios objective-c

我想在显示进度hud时添加文本。 但我不知道如何使用它。 请帮帮我。

MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud.mode = MBProgressHUDModeIndeterminate;

[hud hideAnimated:YES];

2 个答案:

答案 0 :(得分:4)

#import "MBProgressHUD.h"

MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:markerView animated:YES];
hud.mode = MBProgressHUDModeIndeterminate;
hud.label.text = @"Loading";
hud.detailsLabel.text = @"Wait 3 seconds";

//hide MBProgressHUD when process finish
[hud hideAnimated:YES];

从此链接下载:https://github.com/jdg/MBProgressHUD

答案 1 :(得分:1)

你可以设置labeltext

 hud.labelText = @"Loading";

了解详情

hud.detailsLabelText = @"Details";