How to change text color of simple list item

后端 未结 12 2106
清酒与你
清酒与你 2020-11-27 04:12

I have an ListActivity and i am displaying one list with:

setListAdapter(new ArrayAdapter(getApplicationContext(),
                android.R.la         


        
12条回答
  •  一整个雨季
    2020-11-27 04:42

    I'm also faced this situation. You can handle above method. but simple if you pass simple_dropdown_item_1line as resource. It will be black color text by default.

    This is my code I have achieved in kind of situation.

    ArrayAdapter arrAdapter = 
    new ArrayAdapter(context,android.R.layout.simple_dropdown_item_1line,countryList);
            listView.setAdapter(arrAdapter);
    

    Your code below:

    setListAdapter(new ArrayAdapter(getApplicationContext(),
                    android.R.layout.simple_dropdown_item_1line, mStringList));
    

    Actually android.R.layout.simple_dropdown_item_1line is used for dropdown. I urge u to see this layout content once. It just simple textview. thats all. It's property will not affect your task. I checked It works fine.

提交回复
热议问题