SVPProgressHUD 与 MBProgressHUD

来源:互联网 发布:js 转动效果 编辑:程序博客网 时间:2024/06/01 16:16

MBProgressHUD、SVProgressHUD基本使用方法

https://github.com/jdg/MBProgressHUD

https://github.com/TransitApp/SVProgressHUD

1.MBProgressHUD

先导入MBProgressHUD.h .m导入工程,声明MBProgressHUDDelegate

 {

MBProgressHUD* MBHUD;

}

MBHUD= [[MBProgressHUDalloc]initWithView:self.navigationController.view];

MBHUD.delegate = self;

[self.navigationController.view addSubview:MBHUD];

//小菊花

MBHUD.delegate=self;

[MBHUD showWhileExecuting:@selector(XXXX) onTarget:self withObject:nil animated:YES];

//Determinate Mode

MBHUD.mode=MBProgressHUDModeAnnularDeterminate;

MBHUD.delegate=self;

MBHUD.labelText=@"Loading";

[MBHUD  showWhileExecuting:@selector(myProgressTask)onTarget:self withObject:nil animated:YES];

//Dim background

MBHUD.dimBackground=YES;

用完时候实现一下

- (void)hudWasHidden:(MBProgressHUD*)hud {

[hud removeFromSuperview];

hud=nil;

}


2.SVProgressHUD

//感叹号

[SVProgressHUD showInfoWithStatus:@"xxxxx."];

//成功

[SVProgressHUD showSuccessWithStatus:@"Success!"];

//错误

[SVProgressHUD showErrorWithStatus:@"Error"];

个人一般就用这三个,配合大量数据请求的话还是用 MB,个人看法。

0 0