当EditText被LongClicked时,如何禁用弹出的编辑文本?[英] How to disable edittext pop up when EditText is LongClicked?

本文是小编为大家收集整理的关于当EditText被LongClicked时,如何禁用弹出的编辑文本?的处理/解决方法,可以参考本文帮助大家快速定位并解决问题,中文翻译不准确的可切换到English标签页查看源文。

问题描述

Hello我已经使用了onLongClickListener()到了我的EditText视图,但只要我在长时间点击视图,因此出现一个弹出窗口,不会让我在onLongClick(View v)中执行任务. 弹出窗口包含一些选项,如选择全部,选择文本,切割所有,复制所有等. 我想禁用它(在edittext视图上单击长时间时,不应显示). 我该怎么办请帮助我

推荐答案

您可以在OnlongClick侦听器中返回TrongClick方法,这意味着您已经消耗了该事件,并且它不会进一步传递.

其他推荐答案

我在overrodouchevent()overdrodhevent()并返回false时也得到了该弹出窗口.通过返回true来抑制它.

本文地址:https://www.itbaoku.cn/post/102696.html

问题描述

Hello All I have used onLongClickListener() to my EditText view but whenever I click on view for long time so a popup appears that doesn't let me do my task in onLongClick(View v). The pop up contains some options like Select All,Select Text,Cut All ,Copy All etc. I want to disable that (that should not appear on clicking long on EditText view). How can I do that please Help Me

推荐答案

You can return true in your onLongClick listener onLongClick method that means you have consumed the event and it won't be passed further along.

其他推荐答案

I also got that popup when I overrode onTouchEvent() and returned false. Suppress it by returning true.