如何使EditText上不可编辑? [英] How to make EditText not editable?
本文介绍了如何使EditText上不可编辑?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
谁能告诉我如何使通过XML一个EditText不可编辑的?我尝试设置机器人:可编辑为false,但(1)它是德precated和(2)没有工作
Can anyone tell me how to make an EditText not editable via XML? I tried setting android:editable to false, but (1) it is deprecated and (2) it didn't work.
推荐答案
使用这种简单的code:
Use this simple code:
textView.setKeyListener(null);
它的工作原理。
It works.
这篇关于如何使EditText上不可编辑?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文