EditText的editable属性用于设置是否可被编辑,但目前已被deprecate,相关文档说用inputType属性替代,但实际上似乎又无效果,可能是个bug。

只能寻求其他方式实现EditText不可编辑的效果了。虽然editable还是可以运行。

android:editable="false" should work, but it is deprecated, you should be using android:inputType="none" instead.

editable is deprecated (since API level 3). You should instead be using inputType (with the value none).

android:editable is deprecated. android:inputType="none" should be used instead but it contains bug and it does not work. 


EditText editText;

editText.setKeyListener(null);

will work but it just not listening to keys.

User can see a cursor on the edittext.

You can try editText.setEnabled(false);

更多相关文章

  1. Android SystemProperties设置/取得系统属性的用法总结
  2. Android 滑动效果进阶篇(六)—— 倒影效果
  3. 三种方式实现自定义圆形页面加载中效果的进度条
  4. Android至ViewPager添加切换动画——使用属性动画
  5. Android ListView项收缩效果

随机推荐

  1. Android中View的绘制
  2. [Android]如何做一个崩溃率少于千分之三
  3. Android(安卓)基于Socket的聊天应用实例(
  4. android中软键盘enter键更改图标
  5. 移动端开发工程师的AI突围之路
  6. Android它Service
  7. Android(安卓)API Guiede---Animation an
  8. Android下音标字体的相关问题
  9. android Task类
  10. android批量文件上传(android批量图片上传