AutoCompleteTextView 글자색 변경하기
문제점
AutoCompltetTextView 를 사용하는데 있어서 글자색이 하얀색으로 안보이고, textColor을 변경해도 적용되지 않는 문제
해결방안
res/layout 에 새로운 xml 파일을 생성하고 아래와 같이 작성한다.
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    style="?android:attr/dropDownItemStyle"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:gravity="center"
    android:padding="5dp"
    android:textAppearance="?android:attr/textAppearanceMediumInverse"
    android:textColor="#00f" />
Java 코드에서 어댑터를 추가할 때 위 레이아웃을 추가한다.
view = (AutoCompleteTextView)findViewById(R.id.text); ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, R.layout.my_list_item, data); view.setAdapter(adapter);
layout.xml에는 아래와 같이 작성되어 있어야 한다.
<AutoCompleteTextView
    android:id="@+id/text"
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content"
    android:hint="Tapez votre 1texte"
    android:textColor="#000"        
    />
출처 링크
'대학 생활 > Android' 카테고리의 다른 글
| [Android] BadTokenException: Unable to add window -- token null is not for an application (0) | 2015.02.10 | 
|---|---|
| [Android] gps 정보 받아서 다른 스레드에서 textview 값 변경하기 (0) | 2014.12.31 | 
| [Android] the method setbackgrounddrawable(drawable) from the type view is deprecated (0) | 2014.11.14 | 
| [Android] 핸들러(Handler) 사용방법 (0) | 2014.09.12 |