如何在Flutter WebView中启用文本选择模式(复制/粘贴/选择)? [英] How to enable text selection modal(copy/paste/select) in flutter webview?

查看:480
本文介绍了如何在Flutter WebView中启用文本选择模式(复制/粘贴/选择)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以共享代码片段以在Flutter的Web视图中启用文本选择模型吗?到目前为止,我知道默认情况下,webview仅具有一个手势识别器,即垂直滚动.如果有人拥有 LongPressGestureRecognizer 的代码,请在此处共享.预先感谢.

Can anyone please share the code snippet to enable the text selection model in the webview of the flutter? Till now I get that by default webview only has one gesture recognizer i.e. vertical scrolling. If anyone have code for LongPressGestureRecognizer please share it here. Thanks in advance.

推荐答案

已通过更改webview程序包解决.目前,我使用的是 flutter_inappwebview 软件包,它可以正常工作.问题是以前的Webview软件包不支持触摸和保持手势.此外,也可以使用适用于Android和iOS的本地网络视图,但在这种情况下无法显示叠加层.

It was solved by changing the webview package. Currently I am using flutter_inappwebview package and it's working fine. The thing was the previous webview package didn't support the touch and hold gestures. Also, native webview for Android and iOS could also be used but no overlay can be shown in that case.

上面的软件包在两种情况下都可以正常工作.

The above package works fine on both cases.

这篇关于如何在Flutter WebView中启用文本选择模式(复制/粘贴/选择)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆