UIWebView - 捕获点击次数 [英] UIWebView - capturing clicks

查看:109
本文介绍了UIWebView - 捕获点击次数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法捕获UIWebView中链接的点击次数。我想查找用户点击的地址,但实际上并未转到该页面。

Is there a way to capture clicks on links within a UIWebView. I want to find out the address that the user has clicked, but not actually go to the page.

这可能吗?

推荐答案

是的,您可以查看控制器可以实现的委托方法:

Yes there is a delegate method you're view controller can implement:

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType

参考:

http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/参考/ Reference.html#// apple_ref / occ / intfm / UIWebViewDelegate / webView:shouldStartLoadWithRequest:navigationType

这篇关于UIWebView - 捕获点击次数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆