我使用自定义BaseAdapter
和以下getView()方法:
@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;
}
即使我强制文字颜色显示白色(我试过没有强迫它),它看起来像这样:
答案 0 :(得分:0)
textView.setTextColor(0xffffff);
将文字设置为透明白色。