先附上 github 地址:
https://github.com/jdg/MBProgressHUD
https://github.com/TransitApp/SVProgressHUD
1.MBProgressHUD
作者 Matej Bukovinski 是一位全棧工程師, UI/UX 設(shè)計師, 此項目是一款提示框第三方庫, 幫助開發(fā)者快速應(yīng)用到項目中答姥。
先導(dǎo)入MBProgressHUD.h .m導(dǎo)入工程铣除,聲明MBProgressHUDDelegate
{
MBProgressHUD*HUD;
}
//initWithView
HUD= [[MBProgressHUDalloc]initWithView:self.navigationController.view];
HUD.delegate?=?self;
[self.navigationController.view addSubview:HUD];
//小菊花
HUD.delegate=self;
[HUD showWhileExecuting:@selector(XXXX) onTarget:self withObject:nil animated:YES];
//Determinate Mode
HUD.mode=MBProgressHUDModeAnnularDeterminate;
HUD.delegate=self;
HUD.labelText=@"Loading";
[HUD ?showWhileExecuting:@selector(myProgressTask)onTarget:self withObject:nil animated:YES];
//Dim background
HUD.dimBackground=YES;
只是簡單的寫幾種常用,具體用找?guī)У?Demo 就好鹦付,用完時候?qū)崿F(xiàn)一下
- (void)hudWasHidden:(MBProgressHUD*)hud {
[HUD removeFromSuperview];
HUD=nil;
}
就 ok 了
2.SVProgressHUD
又一款輕量級的 iOS 第三方控件, 用于顯示任務(wù)加載時的動畫, 非常輕便, 容易使用.
這個更加輕量級了尚粘,拖入工程就好
//感嘆號
[SVProgressHUD showInfoWithStatus:@"xxxxx."];
//success
[SVProgressHUD showSuccessWithStatus:@"Success!"];
//error
[SVProgressHUD showErrorWithStatus:@"Error"];
個人一般就用這三個,配合大量數(shù)據(jù)請求的話還是用 MB敲长,個人看法郎嫁。