首页 > 其他 > 详细

MBProgressHUD长时间加载无法取消的解决方法

时间:2015-08-04 19:01:23      阅读:3041      评论:0      收藏:0      [点我收藏+]

使用MBProgressHUD时,加载网路数据,或者等待webview加载完毕,长时间的等待导致体验不佳,这时候希望点击屏幕取消加载动画效果;

//  MBProgressHUD.h

@protocol MBProgressHUDDelegate <NSObject>

@optional

/** 
 * Called after the HUD was fully hidden from the screen. 
 */
- (void)hudWasHidden:(MBProgressHUD *)hud;

-(void)hudViewTapGesture;

@end



//  MBProgressHUD.m

-(void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
    if ([self.delegate respondsToSelector:@selector(hudViewTapGesture)]) {
        [self.delegate performSelector:@selector(hudViewTapGesture)];
    }
}


//viewcontroller.m

-(void)hudViewWasTapped {
    [HUD hide:YES];
}

 

MBProgressHUD长时间加载无法取消的解决方法

原文:http://www.cnblogs.com/mangoes/p/4702644.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!