-(void)webViewDidStartLoad:(UIWebView *)webView{
hud=[[MBProgressHUD alloc]initWithView:self.view];
[self.view addSubview:hud];
hud.mode=MBProgressHUDModeDeterminate;
hud.labelText=@"加载中......";
[hud showAnimated:YES whileExecutingBlock:^{
float progress = 0.0f;
while (progress < 1.0f) {
progress += 0.05f;
hud.progress = progress;
usleep(50000);
}
} completionBlock:^{
[hud removeFromSuperview];
}];
hud=[[MBProgressHUD alloc]initWithView:self.view];
[self.view addSubview:hud];
hud.mode=MBProgressHUDModeDeterminate;
hud.labelText=@"加载中......";
[hud showAnimated:YES whileExecutingBlock:^{
float progress = 0.0f;
while (progress < 1.0f) {
progress += 0.05f;
hud.progress = progress;
usleep(50000);
}
} completionBlock:^{
[hud removeFromSuperview];
}];
}