一、高级控件与低级控件区别?
是否使用适配器
二、适配器种类和作用
种类
1、数组适配器 ArrayAdapter
new ArrayAdapter(this,R.layout.actv_style, names);
2、简单适配器 SimpleAdapter
3、自定义适配器
三、高级控件使用步骤
1、获取数据
2、创建适配器
3、绑定适配器
例如:
1、自动提示文本框
独特属性:android:completionThreshold=”2”—–设置输入多少字符时自动匹配
1、AutoCompleteTextView(单一提示)
2、MultiAutoCompleteTextView(多次提示)
设置多次提示时,设置分隔符方法
mactv_main.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:o