アクティビティ内に AutoCompleteTextView があり、本来の方法で実行されます。ドロップダウンの弓は正しいエントリなどで表示されます。問題は、ビューがフォーカスを失うと、テキストが表示されなくなることです。フォーカスが再び得られると、テキストが表示されます。
他の誰かがこの問題を抱えていますか? それはバグですか、それとも私が間違っていることですか?
アクティビティ内に AutoCompleteTextView があり、本来の方法で実行されます。ドロップダウンの弓は正しいエントリなどで表示されます。問題は、ビューがフォーカスを失うと、テキストが表示されなくなることです。フォーカスが再び得られると、テキストが表示されます。
他の誰かがこの問題を抱えていますか? それはバグですか、それとも私が間違っていることですか?
おそらく、アイテムにフォーカスしていない場合、TextColor は現在のテーマの背景色と同じです。そのため、それらを見ることはできません。フォーカスしているアイテムのテキストを参照してください。
解決: background_color に対して別の色を設定します。Adapter を作成するときに android.R.layout.simple_dropdown_item_1line などを使用するか、次のような独自の textViewResourceId を使用できます。
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:textSize="20dp"
android:gravity="center_vertical"
android:id="@android:id/text1"
android:paddingLeft="6.0dip"
android:paddingRight="6.0dip"
android:layout_width="fill_parent"
android:layout_height="50.0dip"
android:textColor="@android:color/black"
android:textColorHighlight="@android:color/black" />
textview の textcolor を設定するのと同じくらい簡単です。
<AutoCompleteTextView
android:layout_width="120dip"
android:layout_height="wrap_content"
android:singleLine="true"
android:ems="10"
android:textColor="@android:color/black" />