- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我想在通过 NSURL 字符串上传期间使用 MBProgressHUD 显示一条消息。所以我编码:
MBProgressHUD *hud1 = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud1.labelText = @"sending info ...";
hud1.minShowTime =10.0;
NSURL *url =[NSURL URLWithString:self.urlToUpload];
10秒时间是为了等待一段时间,我希望用户等待。它有效,但当第一条消息消失时我会显示另一条消息。使用另一个:
MBProgressHUD *hud2 = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
hud2.labelText = @"SENT!";
hud2.minShowTime =2.0;
它没有用,因为此消息与第一个消息重叠。有什么建议吗?
最佳答案
我会删除您的 -connectionDidFinishLoading
方法中的第一个 HUD,或者您收到字符串已成功上传通知的任何位置。
[MBProgressHUD hideHUDForView:self.view animated:YES];
然后您可以在 1-2 秒内添加下一个 HUD。仅通过特定时间添加它,无法在下一个 HUD 显示之前准确删除第一个 HUD。
这取自MBProgressHUD演示项目。我将用它来显示您的定时完成 HUD。
HUD = [[MBProgressHUD alloc] initWithView:self.navigationController.view];
[self.navigationController.view addSubview:HUD];
// The sample image is based on the work by http://www.pixelpressicons.com, http://creativecommons.org/licenses/by/2.5/ca/
// Make the customViews 37 by 37 pixels for best results (those are the bounds of the build-in progress indicators)
HUD.customView = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]] autorelease];
// Set custom view mode
HUD.mode = MBProgressHUDModeCustomView;
HUD.delegate = self;
HUD.labelText = @"Completed";
[HUD show:YES];
[HUD hide:YES afterDelay:3];
关于iphone - 如何使用两个后续的 MBProgressHUD 消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11891080/
仅当我在我的设备(iPhone 6 和 5s)上构建时才会出现此错误。今天当我安装 Firebase/Core 时,它随机弹出。从那以后我就把它删除了。不过,它在模拟器上运行良好。谁能帮我解决一下
我是 iOS 开发的新手,我想运行这个项目 https://github.com/google/uribeacon/tree/master/ios-uribeacon我认为它应该开箱即用。我尝试构建并
有人使用 MBProgressHUD 吗?我想在 MBProgressHUD librairie 提供的示例中使用动画 showWithLabelMixed。我将此代码从示例复制到我的项目中。 -(I
MBProgressHUD 遇到了一点问题。我有一个 WebView ,想要在加载数据时显示 HUD。HUD 出现,但只停留了几秒钟,然后就消失了,但 Web View 尚未完成加载。 -(void)
我使用了我喜欢的 SVProgressHUD,但它不支持方向更改。我正在使用 MBProgressHUD,但它是模态 HUD。 有什么好的替代方案吗?我需要 HUD 是非模态的,并且需要支持方向变化。
在我移动到下一个 View Controller 之前,我想显示 MBProcessHUD 5 秒钟。这是当前的实现 -(void)login { MBProgressHUD *hud = [
我在 AppDelegate 文件中的应用程序中实现 MBProgresshud -(void)showProgressHUD:(NSString*)msg{ if(mbProcess!=nil &&
在我的应用程序中,我正在加载一个资源繁重的 View ,加载大约需要 1 到 2 秒。所以我将它加载到一个单独的线程中,如下所示: hud = [[MBProgressHUD alloc] init]
我在使 MBProgressHUDModeDeterminateHorizontalBar 样式正常工作时遇到一些问题 在 Swift 上还没有找到太多东西。 到目前为止,我已经尝试创建一个将 M
我遇到了一个非常好的 API MBProgressHUD ,但是当我阅读标题中的文档时 MBProgressHUD.h我很困惑,因为文档说 - (id)initWithWindow:(UIWindow
我正在使用 MBProgressHUD 和 STTwitter...我调用 MBProgressHUD,然后从主线程加载 twitter 提要,然后隐藏 HUD。不幸的是,HUD 在收到响应后立即隐藏
我想制作一个“可重用”的 MBProgressHUD。例如,我有一个代码主要是这样的。 - (void)viewDidLoad { HUD = [[MBProgressHUD alloc] i
我有一个场景,我的应用程序仅在第一次下载大量数据,并且这种情况发生在 ViewController1 中。我使用不同的类来下载数据,使用另一个类来保存数据。所以我的问题是,如何更新在 ViewCont
有没有办法让 MBProgressHud 仅在一个选项卡中处于事件状态?目前,由于它在最高 View 中运行,选项卡和 UI 的其余部分没有响应。 最佳答案 是的,有 - 只需将其添加到该选项卡的 R
所以我使用 MBProgressHUD 来加载 View 。我能够让 MBProgressHUDModeIndeterminate 工作并显示它正在加载。但是,每当我尝试使用任何其他类型(例如 MBP
美好的一天! 从网络下载全尺寸图像时,我使用这两个库。 代码: -(void)viewDidAppear:(BOOL)animated { dispatch_async(dispatch_ge
所以我已经实现了 MBProgressHUD 但我想做的是用这行代码调用 MakePost 方法,它是 bool 值,如果正确发布的方法返回 YES 如果不是 NO [HUD showWhileExe
有没有办法像 UIAlertController 那样用窗帘遮住整个屏幕来呈现 MBProgressHUD? 这是 UIAlertController 的样子: 另一方面,这是 MBProgressH
我正在使用这个 api 来分享图片,但是它崩溃了很多次!!!我的代码运行良好,但有时 MBProgressHUD 会导致应用程序崩溃,我是否正确使用了此 API? - (void)shareOther
我正在使用 MBProgressHUD 向用户显示提示,但它没有显示。有许多使用相同方法的viewcontroller。只有一页显示不出来,这个view controller是用xib创建的。方法如下
我是一名优秀的程序员,十分优秀!