2

I am using an AutoCompleteTextView but am running into the problem of white text on a white background in the dropdown menu.

If I start typing in the field the dropdown appears and if I click in the dropdown it chooses the correct item and places it in the text field. I just cannot see what it is I am clicking.

        ctAutoText = new AutoCompleteTextView( this );
        ctAutoText.setHint( "CT Ratio" );
        ctAutoText.setLayoutParams( editLP );
        ctAutoText.setId( 1001 );

        ArrayAdapter<String> adapter = new ArrayAdapter<String>( this, android.R.layout.simple_list_item_1, cTRatioList.toArray( new String[cTRatioList.size()] ) );
        ctAutoText.setAdapter( adapter );
JuiCe
  • 4,132
  • 16
  • 68
  • 119
  • Possible duplicate of [How to change the text color of dropdown in an AutoCompleteTextView?](https://stackoverflow.com/questions/12876840/how-to-change-the-text-color-of-dropdown-in-an-autocompletetextview) – reverie_ss Aug 11 '18 at 13:30

2 Answers2

2

The problem was my ArrayAdapter. Use this:

ArrayAdapter<String> adapter = new ArrayAdapter<String>( this,
             android.R.layout.simple_dropdown_item_1line, 
             cTRatioList.toArray( new String[cTRatioList.size()] ) );
JuiCe
  • 4,132
  • 16
  • 68
  • 119
0

If you want to change the text colour inside dropdow list, please follow:https://stackoverflow.com/a/11787982/1265456

Community
  • 1
  • 1
NamPham
  • 233
  • 1
  • 5
  • 13