GitHub:https://github.com/samvermette/SVProgressHUD
SVProgressHUD和MBProgressHUD效果差不多,不过不需要使用协议,同时也不需要声明实例。
直接通过类方法进行调用即可:
1 | [SVProgressHUD method] |
可以使用以下方法来显示状态:
1 2 3 4 |
+ (void)show; + (void)showWithMaskType:(SVProgressHUDMaskType)maskType; + (void)showWithStatus:(NSString*)string; + (void)showWithStatus:(NSString*)string maskType:(SVProgressHUDMaskType)maskType; |
如果需要明确的进度,则使用以下方法:
1 2 3 |
+ (void)showProgress:(CGFloat)progress; + (void)showProgress:(CGFloat)progress status:(NSString*)status; + (void)showProgress:(CGFloat)progress status:(NSString*)status maskType:(SVProgressHUDMaskType)maskType; |
通过dismiss方法来隐藏提示:
1 | + (void)dismiss; |
另外提供了以下方法用于显示状态,并在1秒后自动隐藏提示(使用的图标来源于Glyphish:http://www.glyphish.com/):
1 2 3 |
+ (void)showSuccessWithStatus:(NSString*)string; + (void)showErrorWithStatus:(NSString *)string; + (void)showImage:(UIImage*)image status:(NSString*)string;// use 28x28 white pngs |
#import "ViewController.h" #import <SVProgressHUD/SVProgressHUD.h> @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } - (IBAction)show:(id)sender { // [SVProgressHUD show]; //SVProgressHUDMaskType 设置显示的样式 [SVProgressHUD showWithMaskType:SVProgressHUDMaskTypeBlack]; [self performSelector:@selector(dismiss:) withObject:nil afterDelay:3]; } - (IBAction)showText:(id)sender { [SVProgressHUD showWithStatus:@"加载中,请稍后。。。"]; [self performSelector:@selector(dismiss:) withObject:nil afterDelay:3]; } - (IBAction)showprogress:(id)sender { [SVProgressHUD showProgress:0 status:@"加载中"]; [self performSelector:@selector(increateProgress) withObject:nil afterDelay:0.3]; } static float progressValue = 0.0f; - (void)increateProgress { progressValue += 0.1; [SVProgressHUD showProgress:progressValue status:@"加载中"]; if (progressValue < 1) { [self performSelector:@selector(increateProgress) withObject:nil afterDelay:0.3]; }else{ [self performSelector:@selector(dismiss:) withObject:nil afterDelay:0.4]; } } - (IBAction)dismiss:(id)sender { [SVProgressHUD dismiss]; } - (IBAction)showSuccess:(id)sender { [SVProgressHUD showSuccessWithStatus:@"success"]; [self performSelector:@selector(dismiss:) withObject:nil afterDelay:3]; } - (IBAction)showError:(id)sender { [SVProgressHUD showErrorWithStatus:@"error"]; [self performSelector:@selector(dismiss:) withObject:nil afterDelay:3]; } @end
相关推荐
另外,还有其他方式打开:比如,有关遮挡背景的:SVProgressHUD.showWithMaskType(this, SVProgressHUD.SVProgressHUDMaskType.None);// 允许遮罩下面控件点击 //SVProgressHUD.showWithMaskType(this,...
SVProgressHud的Category,方便SVProgressHud的设置和展示
相信大家做iOS开发肯定都用户SVProgressHUD 或者 MBProgressHUD,但是觉没觉得很死板呢,可定制性不算是太高,而且动画略丑(个人觉得非常丑)。所以一气之下,自己胡乱写了一个,大家可以看看哦(上面有效果图),...
SVProgressHUD SVProgressHUD是一种简洁易用的HUD,旨在显示iOS和tvOS上正在进行的任务的进度。演示版在上尝试SVProgressHUD 。安装从CocoaPods 是Objective-C的依赖项管理器,它可以自动化并简化在项目中使用诸如...
SVProgressHUDGif 具有gif功能的默认SVProgressHUD 克隆安装手动地将SVProgressHUDGif/SVProgressHUDGif文件夹拖到您的项目中。 注意将SVProgressHUDGif.bundle添加到Targets->Build Phases->Copy Bundle Resources ...
IOS应用源码——SVProgressHUD for iOS.rar
iOS游戏应用源代码——samvermette-SVProgressHUD.zip
作者daiweilai,源码SVProgressActivityIndicatorHud,SVProgressHud很好用,但是它不能高度自定义这个是硬伤!我给它加了一个扩展,让它能够支持很多很漂亮的动画!!!
react-native-SVProgressHUD SVProgressHUD对于您的React应用,支持IOS和Android iOS安装 pod 'SVProgressHUD' Android安装 compile 'com.bigkoo:svprogresshud:1.0.0' 用法 SVProgressHUD.dismiss(); ...
适用于Xamarin.iOS的SVProgressHUD SVProgressHUD是一种简洁易用的HUD,旨在显示iOS和tvOS上正在进行的任务的进度。 在上尝试SVProgressHUD 。Xamarin.iOS绑定此绑定是为了使其在Xamarin.iOS上可以使用,并且可以...
来源:Licence:BSD平台:iOS设备:iPhone / iPad作者:Sam Vermette 实现多种HUD效果。多用于程序正在执行耗时较长命令,需要用户等待。除了显示等待的HUD,还可以显示命令执行成功或者失败的HUD。...
进步 展示了在第 17 课中使用 Carthage 安装 SVProgressHUD。
IOS之弹窗-OC /温馨提示...4、如需在弹窗上展示SVProgressHUD,可设置:[SVProgressHUD setMaxSupportedWindowLevel:UIWindowLevelStatusBar+1];支持pod介绍: pod 'FWPopupViewOC'注意:如出现 [!] Unable to find a
4、如需在弹窗上展示SVProgressHUD,可设置:[SVProgressHUD setMaxSupportedWindowLevel:UIWindowLevelStatusBar+1]; ``` ## 支持pod导入: ```cocoaPods use_frameworks! pod 'FWPopupView' 注意: 1、如出现...
4、基础三方:推送、地图、AFNetworking、JSONKit、Masonry、MJRefresh、SDWebImage、ReactiveObjC、MJExtension、SVProgressHUD 5、页面类型:xib、storyboard、MasonryUI 6、部分自定义工具类、自定义控件...