sp.setOnItemSelectedListener(new OnItemSelectedListener() {
public void onItemSelected(AdapterView<?> arg0, View arg1,
int arg2, long arg3) {
TextView tv=(TextView)arg1;
tv.setTextColor(SearchLocaAct.this.getResources().getColor(R.color.blue));
}
public void onNothingSelected(AdapterView<?> arg0) {
}
});
Android修改spinner显示的文字的字体颜色
最新推荐文章于 2025-08-27 11:08:56 发布
本文介绍了一种在Android应用中修改Spinner控件选中项文字颜色的方法,通过设置OnItemSelectedListener监听器,实现对选中项TextView颜色的自定义。
3780

被折叠的 条评论
为什么被折叠?



