#import
#import "mbprogresshud.h"
@inte***ce mbhudhelper : nsobject
/** * 顯示mbprogresshud指示器
* api parameters 說明
* atitle 標題
* amsg 資訊
* aimg , 為nil時,只顯示標題
* d 延時消失時間, 為0時需要主動隱藏
* blocke 執行的**快
* blockf 結束時的**塊
* 執行時改變hub需要呼叫common_mainfun(afun)
*/#define hiddenmbprogresshud [mbhudhelper hiddenmbprogresshud];
+ (void)hiddenmbprogresshud;
+ (mbprogresshud *)mbprogresshud;
#define showmbprogresshud(atitle, amsg, aimg, adimbg, adelay) [mbhudhelper showmbprogresshudtitle:atitle msg:amsg image:aimg dimbg:adimbg delay:adelay];
+ (mbprogresshud *)showmbprogresshudtitle:(nsstring *)atitle
msg:(nsstring *)amsg
image:(uiimage *)aimg
dimbg:(bool)dimbg
delay:(float)d;
#define showmbprogresshudindeterminate(atitle, amsg, adimbg ,adelay) [mbhudhelper showmbprogresshudmodeindeterminatetitle:atitle msg:amsg dimbg:adimbg delay:adelay];
+ (mbprogresshud *)showmbprogresshudmodeindeterminatetitle:(nsstring *)atitle
msg:(nsstring *)amsg
dimbg:(bool)dimbg
delay:(float)d;
#define showmbprogresshudcancelindeterminate(atitle, amsg, adimbg ,adelay) [mbhudhelper showmbprogresshudcancelindeterminate:atitle msg:amsg dimbg:adimbg delay:adelay];
+ (mbprogresshud *)showmbprogresshudcancelindeterminate:(nsstring *)atitle
msg:(nsstring *)amsg
dimbg:(bool)dimbg
delay:(float)d;
+ (mbprogresshud *)showmbprogresshudtitle:(nsstring *)atitle
msg:(nsstring *)amsg
dimbg:(bool)dimbg
executeblock:(void(^)(mbprogresshud *hud))blocke
finishblock:(void(^)(void))blockf;
+ (mbprogresshud *)showmessag:(nsstring *)message;
@end
#import "mbhudhelper.h"
@implementation mbhudhelper
static mbprogresshud *hud = nil;
+ (void)hiddenmbprogresshud
+ (mbprogresshud *)mbprogresshud
+ (mbprogresshud *)showmbprogresshudtitle:(nsstring *)atitle
msg:(nsstring *)amsg
image:(uiimage *)aimg
dimbg:(bool)dimbg
delay:(float)d
if (nil == hud)
[vc.view addsubview:hud];
if (atitle || amsg)
if (aimg)
hud.removefromsuperviewonhide = yes;
hud.dimbackground = no;
hud.userinteractionenabled = !dimbg;
[hud show:yes];
if (d > 0)
return hud;
}+ (mbprogresshud *)showmbprogresshudmodeindeterminatetitle:(nsstring *)atitle
msg:(nsstring *)amsg
dimbg:(bool)dimbg
delay:(float)d
if (nil == hud)
[vc.view addsubview:hud];
hud.mode = mbprogresshudmodeindeterminate;
hud.labeltext = atitle;
hud.detailslabeltext = amsg;
hud.removefromsuperviewonhide = yes;
hud.dimbackground = dimbg;
[hud show:yes];
if (d > 0)
return hud;
}+ (mbprogresshud *)showmbprogresshudcancelindeterminate:(nsstring *)atitle
msg:(nsstring *)amsg
dimbg:(bool)dimbg
delay:(float)d
if (nil == hud)
[vc.view addsubview:hud];
if (nil == downloadmanager.cancelview)
downloadmanager.cancelview.hidden=no;
[vc.view addsubview:downloadmanager.cancelview];
hud.mode = mbprogresshudmodeindeterminate;
hud.labeltext = atitle;
hud.detailslabeltext = amsg;
hud.removefromsuperviewonhide =no;
hud.dimbackground = dimbg;
[hud show:yes];
if (d > 0)
return hud;
}+ (mbprogresshud *)showmbprogresshudtitle:(nsstring *)atitle
msg:(nsstring *)amsg
dimbg:(bool)dimbg
executeblock:(void(^)(mbprogresshud *hud))blocke
finishblock:(void(^)(void))blockf
if (nil == hud)
[vc.view addsubview:hud];
hud.labeltext = atitle;
hud.detailslabeltext = amsg;
hud.removefromsuperviewonhide = yes;
hud.dimbackground = dimbg;
[hud showanimated:yes whileexecutingblock:^ completionblock:^];
return hud;
}+ (mbprogresshud *)showmessag:(nsstring *)message
if (nil == hud)
[vc.view addsubview:hud];
hud.detailslabeltext = message;
hud.detailslabelfont = [uifont systemfontofsize:15];
hud.mode = mbprogresshudmodetext;
hud.removefromsuperviewonhide = yes;
hud.margin = 10.f;
= uilinebreakmodewordwrap;
[hud show:yes];
[hud hide:yes afterdelay:1.0f];
return hud;
}@end
MBProgressHUD的基本使用
和github上的demo其實差不多,就是小整理了下,當備忘,想做複雜的效果可以參考mbprogresshud在github上的demo,寫得也很清楚明了。以下是 先在.h檔案裡定義 mbprogresshud hud cpp view plain copy 方式1.直接在view上show hud...
MBProgressHUD的基本使用
和github上的demo其實差不多,就是小整理了下,當備忘,想做複雜的效果可以參考mbprogresshud在github上的demo,寫得也很清楚明了。以下是 先在.h檔案裡定義 mbprogresshud hud cpp view plain copy 方式1.直接在view上show hud...
MBProgressHUD的基本使用
和github上的demo其實差不多,就是小整理了下,當備忘,想做複雜的效果可以參考mbprogresshud在github上的demo,寫得也很清楚明了。以下是 先在.h檔案裡定義 mbprogresshud hud 方式1.直接在view上show hud mbprogresshud showh...