iphone - MBProgressHUD或DSActivityView-点击以取消

标签 iphone xcode ios sdk uiprogressview

我遇到过MBProgressHUD和DSActivityView都在iPhone应用程序上显示了黑色的圆角“正在加载”类型的叠加层。

我只是想知道是否有人知道如何扩展这两种方法中的任何一种来检测覆盖的轻敲,以便取消操作。

我已经看到至少有一个带有“正在加载”指示器的应用程序。但是带有文本“点击取消”。

谢谢!

最佳答案

- (void)showHUDWithCancel:(NSString *)aMessage {
    self.HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
    self.HUD.labelText = aMessage;
    self.HUD.detailsLabelText = @"Tap to cancel";
    [self.HUD addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(hudWasCancelled)]];
}

- (void)hudWasCancelled {
    [self.HUD hide:YES];
}

关于iphone - MBProgressHUD或DSActivityView-点击以取消,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5449917/

相关文章:

ios - 如何在不暴露私有(private)函数的情况下在单元测试中操作核心数据?

iphone - iOS 5.0 AVAudioPlayer 加载音频剪辑时出错 : The operation couldn’t be completed.(OSStatus 错误 -50。)

ios - 考虑制作一个开源 iOS 应用程序,我应该在我的 .gitignore 中添加什么?

iphone - 是否可以创建一个可以调用电话并在电话开始和结束时播放声音的应用程序?

ios - Swift 中缺少参数错误的参数

ios - startRecordingToOutputFileURL 没有事件/启用的连接 ios

iphone - GAITrackedViewController 和 UITableViewController

iOS - 在 MFMailComposeViewController 中加载 NSURL

iphone - 使用带有 XML 的字典 (iphone/iOs)

ios - 如何增加整个应用程序的字体大小?