私はそれに基本的AutoCompleteTextView
であり、ArrayAdapter
それに縛られています。Android 4.* では問題なく動作しますが、2.3 ではドロップダウンをスクロールするたびに行がすべて黒でレンダリングされます。行をタップすると、ドロップダウン全体が正しくレンダリングされます。
以下のテキストでは、 TextView が を使用して生成されるときにinflate
、背景色を白 (コメントアウトされた行) に設定すると、スクロールしても常に白が表示されますが、タップ選択効果 (行をシステムに変更して行をタップします) color) は機能しません。
ここでは actionbarsherlock を使用していますが、それが原因ではないことを願っています。何か案は?
スクリーンショット: http://i.imgur.com/gnugp.png
public class AutocompleteAdapter extends ArrayAdapter<String> implements Filterable {
public AutocompleteAdapter(Context context) {
super(context, android.R.layout.simple_dropdown_item_1line);
mInflater = LayoutInflater.from(context);
mContext = context;
}
@Override
public View getView(final int position, final View convertView, final ViewGroup parent) {
final TextView tv;
if (convertView != null) {
tv = (TextView) convertView;
} else {
tv = (TextView) mInflater.inflate(android.R.layout.simple_dropdown_item_1line, parent, false);
//tv.setBackgroundColor(tv.getResources().getColor(R.color.white));
}
tv.setText(getItem(position));
return tv;
}
....