我遇到过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/