Android之AutoCompleteTextView
来源:互联网 发布:最美古诗词 知乎 编辑:程序博客网 时间:2024/04/30 15:28
AutoCompleteTextView是用于总动完成输入文本的组件,用好了是非常方便用户的。
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <AutoCompleteTextView android:id="@+id/auto" android:layout_width="match_parent" android:layout_height="wrap_content" android:completionHint="选中班级" android:completionThreshold="1" //定义了从第几个字符开始显示候补列表 android:dropDownHeight="300dp"/></LinearLayout>
对应的Java代码
AutoCompleteTextView auto = (AutoCompleteTextView) findViewById(R.id.auto);//使用AutoCompleteTextView要用到适配器ArrayAdapter<String> adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1,new String[] { "android", "java", ".net" });//自动提示的选项auto.setAdapter(adapter);
- Android 笔记 之 AutoCompleteTextView
- Android开发之AutoCompleteTextView
- android之autoCompleteTextView
- android之AutoCompleteTextView
- Android--UI之AutoCompleteTextView
- Android之AutoCompleteTextView
- android笔记之autoCompleteTextView
- Android--UI之AutoCompleteTextView
- android示例之AutoCompleteTextView
- Android学习之AutoCompleteTextView
- Android控件之AutoCompleteTextView
- Android控件之AutoCompleteTextView
- Android控件之AutoCompleteTextView
- Android UI之AutoCompleteTextView
- Android开发之AutoCompleteTextView
- Android控件之AutoCompleteTextView
- Android控件之AutoCompleteTextView
- Android基础篇之AutoCompleteTextView
- 【cocos2dx游戏开发技术精解-学习笔记(1)】游戏背景
- 应用程序的打包和发行
- php5.4下安装ECshop出现错误的解决办法
- Mysql资料收集
- 宽动态WDR
- Android之AutoCompleteTextView
- java学习笔记之安装环境变量设置
- 大学英语六级听力--002(Dreams)
- Oracle 中与时间有关的计算
- 用程序控制后台JOB的运行
- 小知识点x=x++%2
- vc2010编译live555——20131018
- uC/OS 的中断——uC/OS学习笔记(三)
- fopen的用法