MBProgressHUD 点击取消,较长的文本?
我想使用 MBProgressHUD (或类似的外观)作为默认 UIAlertView 的替代品。
我需要此视图的取消功能。
我尝试将以下方法添加到 MBProgressHUD 类,但触摸时没有调用它。
有什么想法吗?
(void)touchesEnded:(NSSet *)触摸withEvent:(UIEvent *)事件
我无法使用手势识别器,因为我的最低目标版本是 3.1.2。
另外,放大 MBProgressHUD 文本的标签尺寸似乎很复杂。
除了修复 MBProgessHUD 之外还有其他选择吗?
I'd like to use MBProgressHUD (or similar look) as alternative to default UIAlertView.
I need a canceling capability on this view.
I tried adding the following method to MBProgressHUD class but it didn't get called when touched.
Any idea?
(void) touchesEnded: (NSSet*) touches withEvent: (UIEvent*)event
I can't use gesture recognizer since my lowest target version is 3.1.2.
Also, it seems complex to enlarge label size for MBProgressHUD's text.
Are there altanatives than fixing MBProgessHUD for the purpose?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我只是快速浏览了一下 MBProgressHUD 并会使用它。首先,通过修改MBProgressHUD.h中的layoutSubviews来改变HUD的大小。然后,我将创建一个新的按钮类(UIButton 子类)并将其添加为 HUD 的子视图。
I just had quick look at MBProgressHUD and would use that. First, change the size of the HUD by modifying layoutSubviews in MBProgressHUD.h. I would then create a new button class (UIButton subclass) and add this as a subview of the HUD.
这是一个超级旧的线程,但只需设置 hud 的 UserInteractionEnabled:YES 并向其添加一个 tapGestureRecognizer 会更容易。
干杯。
This is a super old thread, but it would be way easier just to set hud's UserInteractionEnabled:YES and add a tapGestureRecognizer to it.
Cheers.