سؤال

هل هناك طريقة لالتقاط النقرات على الروابط داخل 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 :

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top