我正在用uiwebview为ipad实现一个文本编辑器。我正在使用一个简单的javascript加粗斜体和下划线的文本。
[webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"Bold\")"];
上面的代码用于将文本设置为粗体。
现在我还想实现剪切、复制和粘贴。我正在使用这个代码进行剪切、复制和粘贴。
[webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"Cut\")"]; [webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"Copy\")"]; [webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"Paste\")"];,但它不工作。我是否使用了错误的命令参数,或者有什么方法可以实现它吗?我知道有一个弹出式菜单,它提供所有这些功能,但我想禁用这个弹出式菜单,并想使用我自己的。
谢谢
发布于 2012-08-29 21:28:15
https://stackoverflow.com/questions/12178563
复制相似问题