ActionBar Spinner带有Theme.AppCompat.Light.DarkActionBar的深色文本

时间:2014-05-06 15:54:06

标签: android android-actionbar

我使用自定义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;
    }

即使我强制文字颜色显示白色(我试过没有强迫它),它看起来像这样:

enter image description here

1 个答案:

答案 0 :(得分:0)

textView.setTextColor(0xffffff);将文字设置为透明白色。