【发布时间】:2012-08-29 12:59:49
【问题描述】:
我正在为 ipad 使用 uiwebview 实现一个文本编辑器。我正在使用一个简单的 javascript 来粗体斜体和下划线文本。
[webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"Bold\")"];
上面的代码用于使文本变为粗体。
现在我也想实现剪切、复制和粘贴。我正在使用此代码进行剪切复制和粘贴。
[webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"Cut\")"];
[webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"Copy\")"];
[webView stringByEvaluatingJavaScriptFromString:@"document.execCommand(\"Paste\")"];
但它不工作。我使用了错误的命令参数还是有什么方法可以实现它?
我知道有一个提供所有这些功能的弹出菜单,但我想禁用这个弹出菜单并想自己使用。
谢谢
【问题讨论】:
标签: iphone