How to change the text color of dropdown in an AutoCompleteTextView?

前端 未结 4 1854
难免孤独
难免孤独 2021-01-05 12:32

How can I change the text color in dropdown menu of an AutoCompleteTextView? Or how can I change the background color of a dropdown, by default dropdown\'s back

4条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-05 13:18

    I solved this without inflating the layout using a custom adapter

    1. Simply create a layout autocomplete_custom.xml

      
      
      
    2. Use it in your adapter

      autocomplete.setAdapter(new ArrayAdapter(this,
              R.layout.autocomplete_custom, listContainingText););
      

    Run. Bingo!

提交回复
热议问题