Android用户界面开发(8):自动提示
2013-05-20 20:41
267 查看
自动提示(AutoCompleteTextView)
当用户在输入框输入内容的时候,软件自动提示很多与用户输入的内容相关的内容供用户选择,比如百度。 要实现这个功能首先在布局文件中创建一个AutoCompleteTextView,然后通过ArrayAdapter将我们准备自动提示的内容和AutoCompleteTextView进行适配,这样就可以创建出我们需要的功能了。
源码下载链接:http://www.apkbus.com/android-117094-1-1.html
喜欢开源,乐意分享的大神们,欢迎加入QQ群:176507146,你值得拥有哦!
当用户在输入框输入内容的时候,软件自动提示很多与用户输入的内容相关的内容供用户选择,比如百度。 要实现这个功能首先在布局文件中创建一个AutoCompleteTextView,然后通过ArrayAdapter将我们准备自动提示的内容和AutoCompleteTextView进行适配,这样就可以创建出我们需要的功能了。
auto = (AutoCompleteTextView) this.findViewById(R.id.auto); // 第二个参数表示适配器的下拉风格 ArrayAdapter<String> adapter = new ArrayAdapter<String>(MainActivity.this,android.R.layout.simple_dropdown_item_1line, autoStrings); auto.setAdapter(adapter); mul = (MultiAutoCompleteTextView) this.findViewById(R.id.mul); mul.setAdapter(adapter); //完成对选项的拆分的功能,以逗号进行拆分 mul.setTokenizer(new MultiAutoCompleteTextView.CommaTokenizer());
源码下载链接:http://www.apkbus.com/android-117094-1-1.html
喜欢开源,乐意分享的大神们,欢迎加入QQ群:176507146,你值得拥有哦!
相关文章推荐
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- Eclipse Android开发代码自动提示功能
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- android开发Eclipse首字母和.后面自动提示设置
- 如何实现android蓝牙开发 自动配对连接,并不弹出提示框
- 用eclipse开发android,xml-layout文件不自动提示,Java代码可以自动提示
- android开发中eclipse里xml开发的自动提示和使用帮助快捷键提示
- Android应用开发UI(自动提示)自动补全
- 解决android开发中eclipse不能自动提示
- 解决android开发中eclipse不能自动提示
- android开发 eclipse alt+”/”自动提示失效的解决方法
- Android开发(30)--AutoCompleteTextView和MultiAutoCompleteTextView自动提示输入内容
- Android用户界面开发(21):状态栏提示
- Android ADT开发环境配置代码自动提示功能
- Eclipse中Android开发设置自动提示编辑内容
- android开发 eclipse alt+”/”自动提示失效
- android开发 eclipse alt+”/”自动提示失效
- Android开发——AutoCompleteTextView自动提示控件
- android开发中eclipse里xml开发的自动提示和使用帮助快捷键提示
- Android开发之自动提示框—AutoCompleteTextView