MBProgressHUD、SVProgressHUD基本使用方法

先附上 github 地址:

https://github.com/jdg/MBProgressHUD

https://github.com/TransitApp/SVProgressHUD

1.MBProgressHUD

作者 Matej Bukovinski 是一位全棧工程師, UI/UX 設計師, 此項目是一款提示框第三方庫, 幫助開發(fā)者快速應用到項目中。

先導入MBProgressHUD.h .m導入工程,聲明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 第三方控件, 用于顯示任務加載時的動畫, 非常輕便, 容易使用.

這個更加輕量級了,拖入工程就好


//感嘆號

[SVProgressHUD showInfoWithStatus:@"xxxxx."];

//success

[SVProgressHUD showSuccessWithStatus:@"Success!"];

//error

[SVProgressHUD showErrorWithStatus:@"Error"];

個人一般就用這三個,配合大量數(shù)據(jù)請求的話還是用 MB,個人看法。

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容