2010-02-23 87 views
0

我在我的應用程序中使用了UIWebview,當出現錯誤時,它顯示一條警告消息。UIWebView警報不顯示頁面URL?

消息正常,但警報消息的標題顯示頁面URL,但這並不起作用。

無論如何擺脫這一點,並顯示一個自定義文本呢?

感謝您的幫助。

回答

0

請看執行UIWebViewDelegate protocoll的情況,其中 - (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error被定義。在那裏你應該設置一個UIAlertView- (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles

+0

感謝您的回覆。但是,我不在尋找加載錯誤。我想顯示一條消息,不一定是錯誤。 – Prasanna 2010-02-24 05:05:47

+0

UIWebViewDelegate還有其他幾種在加載webview之前或之後進行反應的方法。這可能會幫助你。 – AlexVogel 2010-02-24 09:34:02