首页 > 移动平台 > 详细

android EditText监听事件及参数详解

时间:2014-01-20 19:29:30      阅读:517      评论:0      收藏:0      [点我收藏+]
bubuko.com,布布扣
 1 editText.addTextChangedListener(new TextWatcher() {
 2     @Override
 3        public void onTextChanged(CharSequence text, int start, int before, int count) { 
 4        //text  输入框中改变后的字符串信息 
 5        //start 输入框中改变后的字符串的起始位置 
 6        //before 输入框中改变前的字符串的位置 默认为0 
 7        //count 输入框中改变后的一共输入字符串的数量 
 8             
 9        } 
10             
11        @Override
12        public void beforeTextChanged(CharSequence text, int start, int count,int after) { 
13        //text  输入框中改变前的字符串信息 
14        //start 输入框中改变前的字符串的起始位置 
15        //count 输入框中改变前后的字符串改变数量一般为0 
16        //after 输入框中改变后的字符串与起始位置的偏移量 
17           
18        } 
19             
20        @Override
21        public void afterTextChanged(Editable edit) { 
22        //edit  输入结束呈现在输入框中的信息 
23          
24        } 
25 });
bubuko.com,布布扣

android EditText监听事件及参数详解

原文:http://www.cnblogs.com/fanrenke/p/3526635.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!