android文本编辑自动提示
来源:互联网 发布:中国经济数据造假严重 编辑:程序博客网 时间:2024/06/05 11:43
UI设计
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="AutoCompleteTextView" /> <AutoCompleteTextView android:id="@+id/autotext" android:layout_width="fill_parent" android:layout_height="wrap_content" > </AutoCompleteTextView> <TextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="MultiAutoCompleteTextView" > </TextView> <MultiAutoCompleteTextView android:id="@+id/mul" android:layout_width="fill_parent" android:layout_height="wrap_content" > </MultiAutoCompleteTextView></LinearLayout>
Main
package com.android.myauto;import android.app.Activity;import android.os.Bundle;import android.widget.ArrayAdapter;import android.widget.AutoCompleteTextView;import android.widget.MultiAutoCompleteTextView;public class Main extends Activity {/** Called when the activity is first created. */private AutoCompleteTextView auto;private MultiAutoCompleteTextView mul;@Overridepublic void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.main);auto = (AutoCompleteTextView) this.findViewById(R.id.autotext);String[] autoStrings = new String[] { "联合国", "联合国安理会", "联合国五个常任理事国","Google", "Google Map" };// 第二个参数表示适配器的下拉风格ArrayAdapter<String> adapter = new ArrayAdapter<String>(Main.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());// 完成对选项的拆分的功能,以逗号进行拆分}}
0 0
- android文本编辑自动提示
- 文本编辑框自动换行
- android-autoComplete 自动提示
- Android 自动提示框
- android 自动提示组件
- Android--AutoCompleteTextView,自动提示
- android自动提示
- android xml 自动提示
- android 自动提示文本框
- android自动提示更新
- Android 富文本编辑
- Android自动提示--AutoCompleteTextView、MultiAutoCompleteTextView
- Android开发自动提示框
- android实现自动提示功能
- Android 代码自动提示功能
- android 中的自动提示框
- android xml 无法自动提示
- Android搜索自动提示功能
- spring AspectJ的Execution表达式-备忘札记
- 规定非合同
- 5种你未必知道的JavaScript和CSS交互的方法
- Matlab画图
- Git常用操作命令和linux系统常用命令
- android文本编辑自动提示
- Java和C++在细节上的差异
- 课堂上那热烈的笑声
- 图的表示
- java中 System.exit(1);是什么意思
- Linux 常用命令收录 -- 持续更新中(个人版)
- 亿米的微信服务平台说明 _ python and django and mysql
- eclise svn
- Office的格式刷是什么