gpt4 book ai didi

ios - 在基于手机间隙/cordova 的 ios 应用程序中禁用 Webview 中输入字段的复制和粘贴。

转载 作者:行者123 更新时间:2023-11-29 03:32:53 25 4
gpt4 key购买 nike

我有一个 phone gap/cordova 应用程序。我有一个包含链接、2 个文本字段和文本的 View 。

I want to remove copy,paste and select option from the web view.

使用:

[webView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitTouchCallout='none';"];

[webView stringByEvaluatingJavaScriptFromString:@"document.body.style.webkitUserSelect='none';"];

我能够从 WebView 中禁用复制粘贴和选择菜单,但它仍然存在于输入字段中,即文本字段。

我尝试的是禁用 webview 上的长按,即禁用放大镜并因此禁用复制和粘贴菜单,但是当我们双击文本字段时也会出现菜单。我如何禁用 webview 上的长按和双击?

我有点困惑,如果我禁用放大镜,我的应用是否会清除应用商店的审核过程。

请帮我解决这个问题。

最佳答案

我认为这已在其他地方讨论过,但最终对我有用的是将以下内容添加到 css。

/******************
disable select touch and hold and highlight colors
******************/
html {
-webkit-user-select: none;
-webkit-touch-callout: none;
-webkit-tap-highlight-color:rgba(0,0,0,0);
}

如果您仍然希望它用于输入,那么我加了

input {
-webkit-user-select: auto !important;
-webkit-touch-callout: default !important;
}

感谢Phonegap styles -webkit-user-select: none; disabling text field

关于ios - 在基于手机间隙/cordova 的 ios 应用程序中禁用 Webview 中输入字段的复制和粘贴。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19541802/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com