zoukankan      html  css  js  c++  java
  • AutoCommpleteText

    一、AutoCompleteText

    Main.xml

    <AutoCompleteTextView

    android:id="@+id/actv1"

    android:layout_width="fill_parent"

    android:layout_height="wrap_content"

    />

    Activity代码

    setContentView(R.layout.main);

            actv1=(AutoCompleteTextView)findViewById(R.id.actv1);

            String[] list={"hi","home","hello"};

            ArrayAdapter<String> ada=new ArrayAdapter<String>(this,R.layout.item, list);

            actv1.setAdapter(ada);

    Item.xml代码

    <?xml version="1.0" encoding="utf-8"?>

    <!--此处不能加LinearLayou标签,否则会出错-->

    <TextView  

           xmlns:android="http://schemas.android.com/apk/res/android"

        android:layout_width="fill_parent"

        android:layout_height="wrap_content"

        />

  • 相关阅读:
    LabVIEW入门第三天(软件及驱动包下载)
    poj1732
    poj1722
    poj1821
    poj1770
    poj1949
    poj1726
    poj1699
    poj1682
    poj1853
  • 原文地址:https://www.cnblogs.com/itfenqing/p/4429516.html
Copyright © 2011-2022 走看看