TextWatcher的使用

来源:互联网 发布:网站连接数据库的函数 编辑:程序博客网 时间:2024/06/05 21:17

public void afterTextChanged(Editable s) 

s   /*表示最终内容*/


public void beforeTextChanged(CharSequence s, int start,int count, int after)

s          /*改变之前的内容*/

start    /*开始的位置*/

count   /*被改变的旧内容数*/

after    /*改变后的内容数量*/

//这里的s表示改变之前的内容,通常start和count组合,可以在s中读取本次改变字段中被改变的内容。而after表示改变后新的内容的数量。
           

public void onTextChanged(CharSequence s, int start, int before, int count)

s          /*改变之后的内容*/

start     /*开始位置*/

count   /*新增数*/ 

before /*改变前的内容数量*/




            
0 0
原创粉丝点击