# Android Spinner
안드로이드에서 `콤보박스`를 구현한다.
### 레이아웃에 spinner 추가
```xml
android:layout_weight="1" />
```
## 데이터 입력
### 리소스에서 추가
```xml
- 서울시
- 경기도
- 강원도
- 충청도
- 전라도
- 경상도
```
### 소스에서 추가
```java
Spinner mCategory = (Spinner)findViewById(R.id.mCategory);
mCategory.setOnItemSelectedListener(this);
ArrayList categories = new ArrayList<>();
categories.add("A");
categories.add("B");
categories.add("C");
categories.add("D");
ArrayAdapter categoryAdapter = new ArrayAdapter(this, android.R.layout.simple_spinner_item, categories);
mCategory.setAdapter(categoryAdapter);
```
### 참고
* http://h5bak.tistory.com/113
* http://deviant86.tistory.com/303
{{tag>android spinner}}