views:

118

answers:

2

Is there a way to programatically remove the selection box of text which the user has selection in a UIWebView?

A: 

Sure... using JavaScript in the HTML document the UIWebView is displaying.

I suspect that's not what you mean by "programmatically", though...

Dan Ray
A: 
NSString * jsCallBack = @"window.getSelection().removeAllRanges();";    
[webView stringByEvaluatingJavaScriptFromString:jsCallBack];
Aaron Saunders
Didn't work - I want to remove the selection with the two handles which appears in the view, but it remains...
LK
huh? "two handles"
Aaron Saunders
when you select text on the ipad/iphone you have the selection box with the two circles you may drag to resize it - I want to be able to remove this selection
LK