How to delete characters at constant speed on EditText in Android during holding Backspace(or Delete) on Software Keyboard

huangapple go评论70阅读模式
英文:

How to delete characters at constant speed on EditText in Android during holding Backspace(or Delete) on Software Keyboard

问题

问题:在安卓操作系统的 EditText 上,

很明显地,当用户在类似智能手机上的软键盘上按一次退格键时,EditText 上只会被删除一个字符。但是当持续按压超过一定时间时,删除速度会随着时间的推移增加,从而一次可能会删除多个单词。

问题:

这种现象让人感到不舒服,因此我想找到在安卓 EditText 上通过 JAVA 或 XML 解决方案,在按住软键盘上的退格(或删除)键时以恒定速度删除字符的方法。

因为我不知道从何处着手,所以我还没有尝试过任何代码。因此,如果有人尝试过并找到了解决方案,我将非常感谢您回答我的问题。谢谢!

英文:

Problem: At EditText on Android OS,

obviously when users press the Backspace key one time on Software keyboard like that in smartphones, only one character on the EditText is erased. But when keeping to press it for longer than a certain time, the deleting speed increases as time passed so that many words have gone at once.

Question:

This phenomenon makes someone uncomfortable, so I want to find JAVA or XML solutions to delete characters at constant speed on EditText in Android during holding the Backspace(or Delete) on Software Keyboard.

Since I have no idea where to start, there's no code I have tried. So if there is anyone who has tried and got a solution, I'd appreciate you answering my question. Thank u!

答案1

得分: 1

你可以了解有关 Android 按钮事件/事件处理程序或其他相关事件的更多信息 =)

  • OnClickListener(点击事件监听器)
  • OnLongClickListener(长按事件监听器)
  • OnTouchListener(触摸事件监听器)
    以上三个事件监听器可能有助于改变文本删除速度。
英文:

You can learn more about Android Button events/event handlers or other related events =)

  • OnClickListener
  • OnLongClickListener
  • OnTouchListener
    the above 3 event linteners may help change the text deleting speed.

huangapple
  • 本文由 发表于 2020年10月20日 14:40:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/64439746.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定