SVProgressHUD的使用

GitHub:https://github.com/samvermette/SVProgressHUD
SVProgressHUD和MBProgressHUD效果差点儿相同,只是不须要使用协议,同一时候也不须要声明实例。
直接通过类方法进行调用就可以:
[SVProgressHUD method]

能够使用下面方法来显示状态:

+ (void)show;
+ (void)showWithMaskType:(SVProgressHUDMaskType)maskType;
+ (void)showWithStatus:(NSString*)string;
+ (void)showWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)maskType;
假设须要明白的进度,则使用下面方法:
+ (void)showProgress:(CGFloat)progress;
+ (void)showProgress:(CGFloat)progress status:(NSString*)status;
+ (void)showProgress:(CGFloat)progress status:(NSString*)status maskType:(SVProgressHUDMaskType)maskType;
通过dismiss方法来隐藏提示:
+ (void)dismiss;
另外提供了下面方法用于显示状态,并在1秒后自己主动隐藏提示(使用的图标来源于Glyphishhttp://www.glyphish.com/):
+ (void)showSuccessWithStatus:(NSString*)string;
+ (void)showErrorWithStatus:(NSString *)string;
+ (void)showImage:(UIImage*)image status:(NSString*)string; // use 28x28 white pngs

也能够定制:

+ (void)setBackgroundColor:(UIColor*)color; // default is [UIColor whiteColor]//背影色

+ (void)setForegroundColor:(UIColor*)color; // default is [UIColor blackColor]//内容颜色,如文字、转圈等

+ (void)setRingThickness:(CGFloat)width; // default is 4 pt

+ (void)setFont:(UIFont*)font; // default is [UIFont preferredFontForTextStyle:UIFontTextStyleSubheadline]//文字样式

+ (void)setSuccessImage:(UIImage*)image; // default is bundled success image from Glyphish//设置图片。下同

+ (void)setErrorImage:(UIImage*)image; // default is bundled error image from Glyphish


posted @ 2014-11-09 16:05  zfyouxi  阅读(554)  评论(0编辑  收藏  举报