欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Android自動(dòng)提示控件AutoCompleteTextView

 更新時(shí)間:2016年12月23日 16:48:57   作者:wei11556  
這篇文章主要介紹了Android自動(dòng)提示控件AutoCompleteTextView的相關(guān)資料,具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

在輸入框中輸入我們想要輸入的信息就會(huì)出現(xiàn)其他與其相關(guān)的提示信息,這種效果在Android中是用AutoCompleteTextView實(shí)現(xiàn)的。

<AutoCompleteTextView 
  android:layout_width="match_parent"
  android:layout_height="wrap_content"
  android:id="@+id/autotext"
  />

public class MainActivity extends Activity {
private AutoCompleteTextView autotext;
private ArrayAdapter<String> arrayAdapter;
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.test);

    autotext =(AutoCompleteTextView) findViewById(R.id.autotext);
    String [] arr={"aa","aab","aac"};
    arrayAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1,arr);
    autotext.setAdapter(arrayAdapter);
  }

}

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

最新評(píng)論