04 AutoCompleteTextView
作用:输入部分文字跳处下拉框列出相应的条目
<pre name="code" class="html">
<!--
当文本框出现两个字符才开始检索列表
android:completionThreshold="2"
默认输入俩个字符 才开始索引
-->
<AutoCompleteTextView
android:id="@+id/actv"
android:layout_width="200dp"
android:layout_height="wrap_content"
android:hint="输入好友姓名"
android:completionThreshold="2"
/> //每次改变之后的是字符串
//before 被删除的元素个数
//count 增加个数
//start开始坐标
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
// TODO Auto-generated method stub
}
//每次改变之后的是字符串
//after 增加个数
//count 删除个数
//start开始坐标
@Override
public void beforeTextChanged(CharSequence s, int start, int count, int after) {
// TODO Auto-generated method stub
}
@Override
public void afterTextChanged(Editable s) {
// TODO Auto-generated method stub
}
});
浙公网安备 33010602011771号