سؤال
هل هناك طريقة لالتقاط النقرات على الروابط داخل UIWebView. أريد لمعرفة العنوان الذي قام المستخدم بالنقر فوق، ولكن لا تذهب في الواقع إلى الصفحة.
هل هذا ممكن؟
المحلول
ونعم هناك طريقة مندوب كنت تحكم الرأي يمكن تنفيذ:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
وإشارة:
<وأ href = "http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIWebViewDelegate/webView:shouldStartLoadWithRequest: navigationType "يختلط =" noreferrer "> http://developer.apple.com/iPhone/library/documentation/UIKit/Reference/UIWebViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UIWebViewDelegate/webView:shouldStartLoadWithRequest: navigationType :
لا تنتمي إلى StackOverflow