关于SVProgressHUD库

作者: AlenChen | 来源:发表于2016-06-17 20:48 被阅读346次

放上下载地址GitHub - SVProgressHUD/SVProgressHUD: A clean and lightweight progress HUD for your iOS and tvOS app.

SVProgressHUD是一个不错的东西,用来做提示框用的,一般用在登录注册等界面时的状态显示,下面稍微说下几种具体用法

+ (void)show; -> 只是简单的显示一个循环转圈的提示框

+ (void)showWithStatus:(NSString*)string; ->显示状态字符

+ (void)showProgress:(CGFloat)progress;->显示进度

+ (void)showProgress:(CGFloat)progress status:(NSString*)status;->显示进度和状态

+ (void)dismiss;->撤销显示

+ (void)dismissWithDelay:(NSTimeInterval)delay;->撤销显示,后面跟上的是时间

下面这些就不解释了 跟字面上的意思一样

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

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

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

+ (void)showImage:(UIImage*)image status:(NSString*)string;

当然,他也可以更改颜色样式

[SVProgressHUDsetBackgroundColor:[UIColor blackColor]];

[SVProgressHUDsetForegroundColor:[UIColor whiteColor]];

用的地方一般是网络请求成功,直接showWithstatus:[@"message"];如果用在非网络上,记得开子线程使用

相关文章

网友评论

本文标题:关于SVProgressHUD库

本文链接:https://www.haomeiwen.com/subject/gamvdttx.html