1

如何更改此标准微调器的颜色?: 问题

因为白底白字并不酷:((谢谢。

4

2 回答 2

1

它可能对更改微调器颜色有用:

mdt_spn=(Spinner)findViewById(R.id.xmdtm_spn);
ArrayAdapter<String> adapter1 = new ArrayAdapter<String>(
        getApplicationContext(),android.R.layout.simple_spinner_item,mdt_arr) {

    public View getView(int position, View convertView,
            ViewGroup parent) {
        View v = super.getView(position, convertView, parent);

        ((TextView) v).setTextSize(30);
        ((TextView) v).setTextColor(getResources().getColorStateList(R.color.mycolor1));
        return v;
    }

    public View getDropDownView(int position, View convertView,
            ViewGroup parent) {
        View v = super.getDropDownView(position, convertView,
                parent);

        ((TextView) v).setTextSize(35);
        ((TextView) v).setTextColor(getResources().getColorStateList(
                R.color.mycolor));


        return v;
    }
};

mdt_spn.setAdapter(adapter1);
于 2013-07-09T16:59:03.603 回答
0

您应该添加:

android:background="@drawable/myspinner_background"
于 2013-07-09T16:58:05.360 回答