码迷,mamicode.com
首页 > 其他好文 > 详细

EditText控件实现只读

时间:2014-09-26 21:40:18      阅读:150      评论:0      收藏:0      [点我收藏+]

标签:android   style   blog   ar   sp   div   on   c   log   

 
android的EditText控件实现只读只需设置三个方法:
editText.setCursorVisible(false);//隐藏光标
editText.setFocusable(false);//失去焦点
editText.setFocusableInTouchMode(false);//虚拟键盘隐藏
如果需记录状态,可以继承EditText类,添加一个属性enable来控制 

EditText控件实现只读

标签:android   style   blog   ar   sp   div   on   c   log   

原文地址:http://www.cnblogs.com/xgjblog/p/3995466.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!