1、继承关系和子类:


2、定义:

An editable text view that shows completion suggestions automatically while the user is typing. The list of suggestions is displayed in a drop down menu from which the user can choose an item to replace the content of the edit box with.

自动完成的文本视图

3、XML重要属性:


4、重要方法:
5、实战:

布局文件 

java代码

package com.example.autocompletetextviewdemo;import android.os.Bundle;import android.support.v7.app.ActionBarActivity;import android.widget.ArrayAdapter;import android.widget.AutoCompleteTextView;public class MainActivity extends ActionBarActivity {private static final String[] COUNTRIES = new String[] { "111", "222","3343", "444", "5555" };@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);ArrayAdapter adapter = new ArrayAdapter(this,android.R.layout.simple_dropdown_item_1line, COUNTRIES);AutoCompleteTextView textView = (AutoCompleteTextView) findViewById(R.id.autoText);textView.setAdapter(adapter);}}
参考1: http://developer.android.com/intl/zh-cn/reference/android/widget/AutoCompleteTextView.html
参考2: http://blog.csdn.net/iamkila/article/details/7230160

更多相关文章

  1. view page 布局tab
  2. Android(安卓)AlertDialog
  3. 关于 getViewTreeObserver
  4. 简单适配器加载列表
  5. Android(安卓)ViewPager 的简单应用
  6. android 将一个上下文菜单列表视图
  7. Fragment嵌套时注意点
  8. Android(安卓)TextView中文本点击文字跳转
  9. AndroidStudio:Could not GET 'https://dl.google.com Received

随机推荐

  1. android 编译错误解决方法(一)
  2. Android(安卓)KEYCODE
  3. Android(安卓)客户端开发
  4. android webview memory leak 线索
  5. Android:应用中使用主题(Themes)
  6. android动态使用FrameLayout(简单使用)
  7. 进度对话框 ProgressDialog__2019.09.05
  8. Android4.4.X调用Alarmmanager接口
  9. 简单翻译android WebView 官网
  10. sensor传感器