http://stackoverflow.com/questions/1305544/how-to-open-uitextview-web-links-in-a-uiwebview-instead-of-safari
The simplest way is to override thewebView:decidePolicyForNavigationAction:request:frame:decisionListener: method onUITextView like so:
@interface UITextView (Override)
@end
@class WebView, WebFrame;
@protocol WebPolicyDecisionListener;
@implementation UITextView (Override)
- (void)webView:(WebView *)webView decidePolicyForNavigationAction:(NSDictionary *)actionInformation request:(NSURLRequest *)request frame:(WebFrame *)frame decisionListener:(id < WebPolicyDecisionListener >)listener
{
NSLog(@"request: %@", request);
}
@end
This will affect all UITextViews in your application. If you only require this on a single view, create a subclass and override the method on that.
Note: this is technically a private API and could be removed at any time. There is no way to do this via the public API.

被折叠的 条评论
为什么被折叠?



