设置微调器背景的颜色(共享微调器)

时间:2013-07-09 16:51:48

标签: android colors background android-actionbar spinner

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

因为白色的白色不酷:((Thx。

2 个答案:

答案 0 :(得分: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);

答案 1 :(得分:0)

你应该添加:

android:background="@drawable/myspinner_background"