网页流量的自定义对话框Textselection [英] Customizing Textselection dialog of webview

查看:121
本文介绍了网页流量的自定义对话框Textselection的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想自定义的WebView的Textselection对话框。(当我们当时preSS longclick出现)
你有什么想法?

I want to customize Textselection dialog of webview.(When we press longclick at that time appear) Do you have any idea?

推荐答案

我不认为你可以自定义。的Andr​​oid 2.2及以下甚至不支持长按响应函数(即没有任何反应,当你长preSS)。

I don't think you can customize that. Android 2.2 and below don't even support the long click response function ( i.e. nothing happens when you long press).

长按是支持的WebView的Andr​​oid 2.3以上版本,并提出了复制和粘贴对话框,但是web视图本身暂时设定为WebTextView模式,让用户选择的话clipborad实现它。您看到的对话框时长preSS是在那个时候长大。 <一href=\"http://grep$c$c.com/file/repository.grep$c$c.com/java/ext/com.google.android/android/2.3.1_r1/android/webkit/WebView.java#WebView.performLongClick%28%29\"相对=nofollow> WebView.performLongClick()

Long click is supported for WebView on Android 2.3+ and brings up the "copy and paste" dialog, but webview implements it by temporarily setting itself into WebTextView mode which allows user to select words to clipborad. The dialog you see when the long press is brought up at that time. WebView.performLongClick()

由于WebTextView是一个私有类,是没有办法,你可以访问它。所以,我认为,即使你可以覆盖onPerformLongClick()方法,prevent从显示出来,你不能对话框并自定义对话框。

Since WebTextView is a private class, there is no way you can access it. So, I think even if you can override the onPerformLongClick() method and prevent the dialog from showing up, you can't get the dialog and customize it.

这篇关于网页流量的自定义对话框Textselection的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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