XYProgressHUD齿诞,git地址是https://github.com/fifyrio/XYProgressHUD,歡迎點星
簡介
A clean and multithreading progress HUD for your iOS
如何使用
#import "XYProgressHUD.h"
只顯示一個HUD(單例)
提示:單例用于顯示單個HUD的場景扯键,如果多個HUD同時顯示围肥,會起沖突
- 顯示文字虫蝶,自動隱藏
[XYProgressHUD showStatus:@""];
- 顯示文字以一定時間桩卵,自動隱藏
[XYProgressHUD showStatus:@"" duration:duration];
- 顯示加載動畫以一定時間,自動隱藏
[XYProgressHUD showLoadingWithDuration: duration];
- 顯示加載動畫和文字以一定時間劲弦,自動隱藏
[XYProgressHUD showLoadingWithDuration: duration status:@""];
- 顯示加載動畫不限時間耳标,手動隱藏
[XYProgressHUD showLoadingIndefinitely];
- 顯示加載動畫和文字不限時間,手動隱藏
[XYProgressHUD showLoadingIndefinitelyWithStatus:@""];
- 隱藏
[XYProgressHUD dismissLoading];
- 隱藏以一定時間
[XYProgressHUD dismissLoadingWithDelay:duration];
只顯示一個HUD(非單例)
提示:非單例用于依次顯示多個HUD的場景,采用FIFO(先進先出)策略
- 顯示文字邑跪,自動隱藏
[[XYProgressHUD initHUD] fifo_showStatus:@""];
- 顯示文字以一定時間次坡,自動隱藏
[[XYProgressHUD initHUD] fifo_showStatus:@"" duration:duration];
- 顯示加載動畫以一定時間,自動隱藏
[[XYProgressHUD initHUD] fifo_showLoadingWithDuration:duration];
- 顯示加載動畫和文字以一定時間画畅,自動隱藏
[[XYProgressHUD initHUD] fifo_showLoadingWithDuration:duration status:@""];
同時顯示多個HUD(非單例)
- showStatus->showStatus
XYProgressHUD *hud_1 = [XYProgressHUD initHUD];
[hud_1 fifo_showStatus:@"" duration:duration];
XYProgressHUD *hud_2 = [XYProgressHUD initHUD];
[hud_2 fifo_showStatus:@"" duration:duration];
- showLoading->showStatus
XYProgressHUD *hud_1 = [XYProgressHUD initHUD];
[hud_1 fifo_showLoadingWithDuration:duration];
XYProgressHUD *hud_2 = [XYProgressHUD initHUD];
[hud_2 fifo_showStatus:@"" duration:duration];
- showLoading->showLoading
XYProgressHUD *hud_1 = [XYProgressHUD initHUD];
[hud_1 fifo_showLoadingWithDuration:duration];
XYProgressHUD *hud_2 = [XYProgressHUD initHUD];
[hud_2 fifo_showLoadingWithDuration:duration];
- showLoadingStatus->showStatus
XYProgressHUD *hud_1 = [XYProgressHUD initHUD];
[hud_1 fifo_showLoadingWithDuration:duration status:@""];
XYProgressHUD *hud_2 = [XYProgressHUD initHUD];
[hud_2 fifo_showStatus:@"" duration:duration];
提示
如何替換加載動畫圖片
直接修改Resources文件夾里的圖片文件即可