第三方 MBProgressHUD的简单使用方法
第一步导入文件并引头文件
#import
"MBProgressHUD.h"
第二步签协议
MBProgressHUDDelegate
第三步 设置属性 用类方法初始化
@property
(
nonatomic
,
retain
)
MBProgressHUD
*HUD;
self
.
HUD
= [[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
]
retain
];
self . HUD . center = self . view . center ;
[ self . view addSubview : self . HUD ];
self . HUD . delegate = self ;
self . HUD . mode = MBProgressHUDModeIndeterminate ;
self . HUD . center = self . view . center ;
[ self . view addSubview : self . HUD ];
self . HUD . delegate = self ;
self . HUD . mode = MBProgressHUDModeIndeterminate ;
self.HUD.labelText = @"加载中...";
//
菊花效果消失
[self hudWasHidden:_HUD];
//
隐藏菊花
[self hudWasHidden:self.HUD];
//
菊花效果消失
-( void )hudWasHidden:( MBProgressHUD *)hud{
[hud removeFromSuperview ];
hud = nil ;
-( void )hudWasHidden:( MBProgressHUD *)hud{
[hud removeFromSuperview ];
hud = nil ;
}