> For the complete documentation index, see [llms.txt](https://easonwang.gitbook.io/android/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://easonwang.gitbook.io/android/listview.md).

# listView

先在 xml 建立

```markup
    <ListView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:id="@+id/listView1"
        />
```

然後使用 adapter

```java
ListView listView = findViewById(R.id.listView1);
ArrayAdapter listAdapter = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new String[]{"一", "二", "三"});
listView.setAdapter(listAdapter);
```

> android.R.layout.simple\_list\_item\_1 為原生提供

<https://qiita.com/vc7/items/3fe9edded4b8306646f5>
