问题:android:editable is deprecated: Use an to make it editable
 
意思:Android的:编辑是反对:使用<</span> EditText >对其编辑
分析:关于EditText控件的read-only问题,即: 无法通过UI更改其中的内容, 但可以选定部分内容, 进行复制.在早期的sdk, EditText有Editable属性, 现在这个属性已经deprecated了.
 
解决方法:
其实只需一行代码就能搞定et.setKeyListener(null);
注意, 这里不是setOnKeyListener, 而是setKeyListener. 此方法是TextView的成员, 调用后的效果完全符合预期, 并且获得焦点后不会弹出输入法. 
 
下面是官方文档的解释
Sets the key listener to be used with this TextView. This can be null to disallow user input. Note that this method has significant and subtle interactions with soft keyboards and other input method: see KeyListener.getContentType() for important details. Calling this method will replace the current content type of the text view with the content type returned by the key listener.
 
Be warned that if you want a TextView with a key listener or movement method not to be focusable, or if you want a TextView without a key listener or movement method to be focusable, you must call setFocusable again after calling this to get the focusability back the way you want it.

android:editable is deprecated: Use an <EditText> to make it editable的更多相关文章

  1. 安卓onTextChanged参数解释及实现EditText字数监听 Editable使用

    原作者部分修改部分 补充部分 补充部分2 补充部分3 补充部分4 Editable 尊重原作者:此篇文章是借鉴原作者地址 的博文 并进行修改和增加补充说明,我只是补充和修改: 我感觉这篇文章经过我的补 ...

  2. The android command is deprecated

    新版的SDK tools中的android命令已经不支持 android create project,用起来很不顺手. The "android" command is depr ...

  3. Android图文混排-实现EditText图文混合插入上传

    前段时间做了一个Android会议管理系统,项目需求涉及到EditText的图文混排,如图: 在上图的"会议详情"中.须要支持文本和图片的混合插入,下图演示输入的演示样例: 当会议 ...

  4. 50个Android开发技巧(09 避免用EditText对日期进行验证)

    我们都知道,在表单中对数据进行验证不但无聊并且easy出错. (原文地址:http://blog.csdn.net/vector_yi/article/details/24424713) 想象一下,一 ...

  5. android 随着认识的去除率EditText(它配备了防抖效果)

    Android它没有提供的类似至ios自带的输入框效果清晰(ios简单地只加属性可实现).因此,Android其中 我们要如何实现就需要这种效果用自己的定义的控件实现. 思路:能够使用一个Linear ...

  6. 在android中如何通过点击edittext之外的部分使软键盘隐藏

    我们知道在android中点击edittext框就会自动弹出软键盘,那怎么通过点击edittext之外的部分使软键盘隐藏呢?(微信聊天时的输入框就是这个效果,这个给用户的体验还是很不错的) 首先我们要 ...

  7. Android开发 解决AlertDialog中的EditText无法调出输入法的问题

    在AlertDialog中使用自定义的View,如果View中有EditText,在上面点击,默认是跳不出软键盘的,不是焦点的问题.解决方法,有两种,一是把AlertDialog换成Dialog,但这 ...

  8. Android 入门(2)修改EditText下划线颜色 / 隐藏标题栏

    1 添加颜色 colors.xml中增加 <color name="colorRed">#FF3300</color> 2 添加style styles.x ...

  9. Android中软键盘展示、EditText焦点获取及windowSoftInputMode属性探究

    2017-08-14 21:44:23 有很多中情况,分别展示. 1.Activity不做任何设置,布局使用LinearLayout 会自动滚动EditText之上的所有View,代码: <?x ...

随机推荐

  1. erlang四大behaviour之四-supervisor

    http://www.cnblogs.com/puputu/articles/1689621.html 1. 监督规则 一个监督者负责启动.停止.监控他的子进程.监督者的一个基本概念就是当必要的时候重 ...

  2. Python 学习笔记9

    梦想和我只有一层纸的距离. 接着看Python类:http://www.pythondoc.com/pythontutorial3/classes.html

  3. Linux openvswitch性能调优

    Increasing the flow-eviction threshold The threshold is a type of limit on the number of flows that ...

  4. js深入理解构造函数和原型对象

    1.在典型的oop的语言中,如java,都存在类的概念,类就是对象的模板,对象就是类的实例.但在js中不存在类的概念,js不是基于类,而是通过构造函数(constructor)和原型链(propoty ...

  5. hadoop性能测试命令

    1.测试hadoop写的速度向HDFS文件系统中写入数据,10个文件,每个文件10MB,文件存放到/benchmarks/TestDFSIO/io_data中hadoop  jar share/had ...

  6. 将dom4j格式化为标准的xml字符串

    StringWriter writer = new StringWriter(); OutputFormat format = OutputFormat.createPrettyPrint(); fo ...

  7. java线程数据交换Exchanger

    两个线程都等到交换函数才能完成交换数据操作,代码如下: package threadLock; import java.util.Random; import java.util.concurrent ...

  8. VBS基础篇 - 对象(1) - Class对象

    VBS基础篇 - 对象(1) - Class对象   相信对JAVA有一定了解的朋友一定对类这个名词不陌生,但是大家可能没有想过在VBS中使用Class类吧,其实Class类在自动化测试中是相当常用的 ...

  9. 怎么破解Wifi密码

    破解无络网络Wifi密码,让手机上Wifi不再受限. 方法/步骤 1 上网搜索并下载“Wfi万能钥匙”APK程序,然后将其安装到手机内存中.可以借助手机类管理软件将APK应用安装到手机中. 步骤阅读 ...

  10. C++ 中 const和define的区别

    来源网址:http://wujiangping.blog.163.com/blog/static/195182011201255115125205/ 请区别用#define命令定义的符号常量和用con ...