本文介绍的是Android常用控件AutoCompleteTextView的使用方法
下面是导读:
1.什么时AutoCompleteTextView
2.如何使用AutoCompleteTextView
3.总结
1.什么是AutoCompleteTextView?
在输入框中输入我们想要输入的信息就会出现其他与其相关的提示信息,这种效果在Android中是用AutoCompleteTextView实现的。
下图是Android6.0系统的AutoCompleteTextView样式:
2.如何使用AutoCompleteTextView?
第一步:在布局文件中创建AutoCompleteTextView
<AutoCompleteTextView
android:layout_width="384dp"
android:layout_height="wrap_content"
android:id="@+id/auto"
android:hint="自动补全demo"
android:textSize="16sp"
tools:layout_editor_absoluteY="318dp"
app:layout_constraint