MBProgressHUD

MBProgressHUDis an iOS drop-in class that displays a translucent HUD with an indicator and/or labels while work is being done in a background thread. The HUD is meant as a replacement for the undocumented, privateUIKitUIProgressHUDwith some additional features.

方法 使用 

//  填加到提供的view上 ,并显示它。 与之对应的方法 是 hideHUDForView:animated:.
    如果 animated 设置为 YES the HUD 显示的时候 用 当前的animationType 如果 为no 则不用。

+ (MB_INSTANCETYPE)showHUDAddedTo:(UIView *)view animated:(BOOL)animated;


// Finds the top-most HUD subview and hides it ;该方法设置了 removeFromSuperViewOnHide  , 当 the HUD hidden 时 自动 被 removed ;@return YES if a HUD was found and removed, NO otherwise.

+ (BOOL)hideHUDForView:(UIView *)view animated:(BOOL)animated;


//Finds all the HUD subviews and hides them;The HUDs will automatically be removed from the view hierarchy when hidden;return the number of HUDs found and removed.

+ (NSUInteger)hideAllHUDsForView:(UIView *)view animated:(BOOL)animated;


用法:

[MBProgressHUDshowHUDAddedTo:self.viewanimated:YES];dispatch_async(dispatch_get_global_queue( DISPATCH_QUEUE_PRIORITY_LOW,0), ^{// Do something...dispatch_async(dispatch_get_main_queue(), ^{        [MBProgressHUDhideHUDForView:self.viewanimated:YES];    });});

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容