Cómo se toca UIWebView detect <img src = “…” />
Sé que el siguiente método puede detectar un elemento de enlace. Pero quiero saber si elUIView
puede detectar si elimg
¿Se toca el elemento?
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
switch (navigationType) {
case UIWebViewNavigationTypeLinkClicked:
NSLog(@"link is click");
//do something
break;
default:
break;
}
return true;
}
Algunas fuentes de HTML como a continuación:
<p>xxxxxxxxx</p>
<p><img src="http://imgs.ebrun.com/resources/2015_06/2015_06_16/201506167911434413787546.jpg"> </p>
<p>xxxxxxxxx。</p>
<p><img src="http://imgs.ebrun.com/resources/2015_06/2015_06_16/201506167911434413787546.jpg"> </p>
<p>xxxxxxxxx。</p>
¿Podría mostrarme cómo hacerlo usando un código de muestra? Gracias.