iOS开发:SVProgressHUD的使用

一、简单介绍。

1、SVProgressHUD是一个弹出提示层的第三方控件,用来提示网络加载或者提示对错的。

2、地址:https://github.com/SVProgressHUD/SVProgressHUD

二、具体使用。

1、下载下来放在项目中。

2、直接应用#import “SVProgressHUD.h"

3、不需要使用协议,不需要声明实例,直接通过类方法进行调用->[SVProgressHUD method];

三、常用方法。

1、没有进度条。

+ (void)show;

+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;

+ (void)showWithStatus:(NSString*)status;

+ (void)showWithStatus:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;

2、有进度条,

+ (void)showProgress:(float)progress;

+ (void)showProgress:(float)progress maskType:(SVProgressHUDMaskType)maskType;

+ (void)showProgress:(float)progress status:(NSString*)status;

+ (void)showProgress:(float)progress status:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;

3、成功或者失败。(会自动消失,展示的时长有计算规则)

+ (void)showSuccessWithStatus:(NSString*)string;

+ (void)showSuccessWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)maskType;

+ (void)showErrorWithStatus:(NSString*)string;

+ (void)showErrorWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)maskType;

4、隐藏。

+ (void)dismiss;

5、SVProgressHUDMaskType介绍。

typedefNS_ENUM(NSUInteger, SVProgressHUDMaskType) {

SVProgressHUDMaskTypeNone =1,//允许操作其他UI

SVProgressHUDMaskTypeClear,//不允许操作

SVProgressHUDMaskTypeBlack,// 不允许操作,背景色是黑色

SVProgressHUDMaskTypeGradient//不允许操作,背景色是渐变色

};

你可能感兴趣的:(iOS开发:SVProgressHUD的使用)