


















我觉得会一种就可以了,综合前辈们的经验选择了后者,然后就花了一点时间,把他的方法都看了一下。在这里用作记录,供自己巩固和查阅。
SVProgressHUD所以的方法都是类方法,并且对象是通过单例创建。由于方法都是通过类名调用,简单明了。
+ (void)show; 显示:状态是一个迅速转动的圈
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType; 显示并且带着一个状态
+ (void)showWithStatus:(NSString*)status; 显示并且带着文字
+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
+ (void)showProgress:(float)progress;
+ (void)setBackgroundColor:(UIColor*)color; //背景颜色 // default is [UIColor whiteColor]
+ (void)setForegroundColor:(UIColor*)color;
extern NSString * const SVProgressHUDDidReceiveTouchEventNotification; 在HUD外点击
extern NSString * const SVProgressHUDDidTouchDownInsideNotification; 在HUD中点击
extern NSString * const SVProgressHUDWillDisappearNotification; 将要显示
extern NSString * const SVProgressHUDDidDisappearNotification; 已经显示
extern NSString * const SVProgressHUDWillAppearNotification; 将要消失
extern NSString * const SVProgressHUDDidAppearNotification; 已经消失
extern NSString * const SVProgressHUDStatusUserInfoKey; HUD的状态
在通知中userInfo字典中存储了HUD的状态,其key为SVProgressHUDStatusUserInfoKey
/**
* 类方法
*/
/*
MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
@weakify(hud)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
@strongify(hud)
[MBProgressHUD hideAllHUDsForView:self.view animated:YES];
});
*/
/**
* 实例方法
*/
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:self.view];
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。