1

読み込み用に別のURLを渡しながら、UIWebViewのWebページの読み込みを停止したい。

4

2 に答える 2

5

以下を実装する必要があります。

- (BOOL)webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType

UIWebViewDelegateプロトコルのメソッドとNO、ロードしたくないすべてのURLを返します。

例:

- (BOOL)webView:(UIWebView *)inWeb shouldStartLoadWithRequest:(NSURLRequest *)inRequest navigationType:(UIWebViewNavigationType)inType {
    if ([[inRequest URL] isEqual:someMyUrl]) {
        return YES;
    }
    return NO;
}
于 2013-02-15T09:32:28.733 に答える
1
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];
于 2013-02-15T09:31:05.797 に答える