问题描述
我正在使用ionic和cordova来构建混合应用程序。
I am using ionic and cordova to build a hybrid application.
但是,我无法从任何webview复制文本。从我的Android手机或浏览器,复制文本不起作用。选择文本并拖动指针不会做任何事情。
However, I can't copy text from any of my webviews. From my Android phone or from the browser, copying text does not work. Selecting text and dragging the pointer does nothing.
这种情况发生在例如由离子启动myApp标签生成的基本应用程序
。
This occurs for instance with the basic app generated by ionic start myApp tabs
.
简单地说,我怎样才能允许用户复制粘贴?
Simply put, how can I allow users to copy-paste?
推荐答案
将 ion-content
改为 overflow-scroll =true
并为你的copyable添加一个类text
Make ion-content
to overflow-scroll="true"
and add a class to your copyable text
.selectable{
-webkit-user-select: auto;
}
您现在无法以编程方式从javascript复制任何内容到剪贴板。但是,它可以通过插件
You cannot copy anything to clipboard from javascript for now programmatically. However it can be done from native side via plugin CordovaClipboard
这篇关于如何从离子webview中复制和粘贴?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!