【发布时间】:2014-02-11 14:28:19
【问题描述】:
我使用了简单的光标适配器来设置微调器的适配器,因为我使用了 sqlite 数据库。但我无法自定义微调器的字体颜色,
这是我的微调器的网址,背景为深红色,我想使用带有微调器 android 的简单光标适配器将文本颜色更改为白色
代码:
Cursor cursor = dbAdapter.getAllData();
if(cursor.getCount()>0){
String[] from = new String[]{"columm_name"};
// create an array of the display item we want to bind our data to
int[] to = new int[]{android.R.id.text1};
SimpleCursorAdapter mAdapter = new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, cursor, from, to);
mAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
spinnerName.setAdapter(mAdapter);
【问题讨论】:
-
希望链接能帮到你,stackoverflow.com/questions/5836254/…问候
-
使用 ArrayAdapter 我可以使用 ArrayAdapter 进行更改,但不能使用 SimpleCurssor 适配器。当我在简单的光标适配器中使用我自己的文本视图时,它不显示任何文本