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,个人看法。