Android Question Changing colors of AutoCompleteTextView

Inman

Well-Known Member
Licensed User
When AutoCompleteTextView displays the dropdown for text suggestions, the dropdown background color is black (or Holo Dark) while dropdown text is white. Since my app uses Holo Light theme, I wanted to invert this. I managed to change the dropdown background color by setting setDropDownBackgroundDrawable using Java Object but I couldn't find an option to change the text color of dropdown.

How can I change it?
 

DonManfred

Expert
Licensed User
if you are using this class you can change the ListViews layout to fit your needs in SearchView.bas
B4X:
lv.Initialize("lv")
lv.SingleLineLayout.ItemHeight = 50dip
lv.SingleLineLayout.Label.TextSize = 14
Just add more layout-commands to change the listitems-layout, font-color and so on.
 

Inman

Well-Known Member
Licensed User
I did see SearchView but the problem is that I use the layout values of the EditText in many parts of the code, to design the UI. Since AutoCompleteTextView inherits from normal EditText, I can use it without any changes to the code. But SearchView is a bit more complicated. I can't access it's layout values directly and I think it's height is actually the total height of EditText and ListView but I use EditText.Height in many parts of the code, so changing it will be tough.

EDIT:
Never mind. After changing the background with setDropDownBackgroundDrawable, I changed the text color of dropdown using SetItems2.
 
Last edited:
Top