UIWebView如何处理HTML中的图像?

时间:2012-09-05 22:07:21

标签: iphone ios uiwebview nsurlrequest

我想知道UIWebView在从标准NSURLRequest接收HTML时如何处理图像。例如,如果我有以下HTML;

<body>
  <!-- header -->
  <header>
    <div class="container">
    <img src="images/logo.jpg" WIDTH="500" HEIGHT="60" alt="pingpong">
    </div>
  </header>

// then the rest of the site (txt, links, more pics etc)
</body>

所以考虑上面的HTML,如果我像这样对这个HTML发出以下请求;

- (void)viewDidLoad {

    NSString *urlAddress = @"http://www.myurl.com";

    //Create a URL object.
    NSURL *url = [NSURL URLWithString:urlAddress];

    //URL Requst Object
    NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

    //Load the request in the UIWebView.
    [webView loadRequest:requestObj];
}

当'webView'通过loadRequest调用收到'requestObj'时,webview如何处理HTML中的图像?

<img src="images/logo.jpg" WIDTH="500" HEIGHT="60" alt="pingpong">

遇到像这样的图像时UIWebView做了什么?它如何获取图像数据/文件等?

0 个答案:

没有答案