textView.setTextColor(0xffffff);
sets the text to transparent white.
ActionBar Spinner dark text with Theme.AppCompat.Light.DarkActionBar
-
16-07-2023 - |
Pregunta
I am using a custom BaseAdapter
with the following getView() method:
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if(getItemViewType(position) == VIEW_TYPE_HEADER) {
convertView = inflater.inflate(R.layout.actionbarspinner_header, parent, false);
} else {
convertView = inflater.inflate(android.R.layout.simple_dropdown_item_1line, parent, false);
assert convertView != null;
TextView textView = (TextView) convertView.findViewById(android.R.id.text1);
textView.setText("Manage stores");
textView.setTextColor(0xffffff);
}
return convertView;
}
And even though I force the text color to show white (I have tried without forcing it), it looks like this:
Solución
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow