禁用 UIWebView 中的图像选择
我有一个 UIWebView,其中加载了图像,当我点击图像时,有时它在图像/图像边框上有灰色突出显示。单击/点击图像时如何禁用此功能?我必须通过 javascript 执行此操作吗?
I have a UIWebView with images loaded in it, when I tap on the image sometimes it has a grayish highlight on the image/image border. How do I disable this when I click/tap on the image? Do I have to do this via javascript?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您只想禁用链接
If you want to disable links only
如果图像是链接,以下功能可能会有所帮助。
你也可以研究一下这个函数。
If the image is a link, the below function may be helpful.
You can also look into this function.
你可以在你的js中尝试这个:
document.documentElement.style.webkitTapHighlightColor = "rgba(0,0,0,0)";
document.documentElement.style.webkitTouchCallout = "无";
You can try this in your js:
document.documentElement.style.webkitTapHighlightColor = "rgba(0,0,0,0)";
document.documentElement.style.webkitTouchCallout = "none";