2012-02-17 13 views
0

我正在使用MBProgressHUD在加載某些網頁時顯示微調。xcode:在uiWebview上加載「Twitter」頁面時使用MBProgressHUD

對某些網站,它的偉大工程,但試圖打開時,「推特」賬戶頁面,微調依然在屏幕上,這意味着Web視圖沒有完成加載尚未..

這裏是我的代碼,爲其他網站比Twitter的工作原理:

- (void)webViewDidStartLoad:(UIWebView *)web 
{ 
MBProgressHUD *HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES]; 
HUD.labelText = @"Loading.."; 
} 

- (void)webViewDidFinishLoad:(UIWebView *)web 
{ 

[MBProgressHUD hideHUDForView:self.view animated:YES]; 
} 

在viewDidLoad中:

NSURL *urlAddress = [NSURL URLWithString: @"https://twitter.com/#!/Applicaphone"];  
NSURLRequest *requestObject = [NSURLRequest requestWithURL:urlAddress]; 
[webView loadRequest:requestObject]; 

回答

0

好吧,我完成了通過使用MBProgressHUD與延遲:

[HUD hide:YES afterDelay:4.7];