views:

160

answers:

1

I have several custom UIMenuItems that do things with a selection in a UIWebView. After the action has been run on that selection I want to hide the selection handles just as copy: does.

I have tried using window.getSelection().removeAllRanges(); and that works in that window.getSelection() no longer returns anything but the text selection handles stay visible.

Is there a way to remove the selection and the handles with it?

Edit: I don't need it to be a JS solution but I can't loose the state by reloading the webview.

A: 

you can simply refresh the webview if your data is only text then no body can trace that webview is refreshed

use this code

[webview reload];

i have done this thing in my apps & its work great

Tarun Mittal
I can't reload the whole webview as that would change state that is in the webview. I just need to get those handles to disappear. ;)
MattLeff