您的位置:首页 > 其它

关于修改spinner显示文字的颜色设置或者其他设置

2013-09-09 14:42 405 查看
spinner = (Spinner) view.findViewById(R.id.crow_search_select);

ArrayAdapter<CharSequence> arrayAdapter = ArrayAdapter.createFromResource(App.activity, R.array.search_orders,

R.layout.spinner_text_color);// android.R.layout.simple_spinner_item

arrayAdapter.setDropDownViewResource(R.layout.crowd_spinner_dropdown_item);

spinner.setAdapter(arrayAdapter);

spinner.setOnItemSelectedListener(new OnItemSelectedListener() {

@Override

public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {

searchOrderType = position;

beginSearch();

}

@Override

public void onNothingSelected(AdapterView<?> parent) {

}

});

这里ArrayAdapter<CharSequence> arrayAdapter = ArrayAdapter.createFromResource(App.activity, R.array.search_orders,

R.layout.spinner_text_color);

R.layout.spinner_text_color是自定义的textview

<?xml version="1.0" encoding="utf-8"?>

<TextView xmlns:android="http://schemas.android.com/apk/res/android"

android:id="@android:id/text1"

style="?android:attr/spinnerItemStyle"

android:singleLine="true"

android:layout_width="match_parent"

android:layout_height="wrap_content"

android:ellipsize="marquee"

android:textColor="#ffffff"/>

是根据系统的修改添加了textcolor属性之后的

这样就可以修改spinner的显示文字的颜色了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐