0
我已經使用簡單的光標適配器爲微調器設置適配器,因爲我已經使用了sqlite數據庫。但我不能夠定製微調的字體顏色,更改文本顏色微調項目顯示
這裏是我的飛旋的URL有暗紅色的背景我想用簡單的遊標適配器來改變文字顏色爲白色與微調的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);
我希望鏈接可以幫助你,http://stackoverflow.com/questions/5836254/android-在項目中改變文本顏色的項目 Regards – ShawnWang
使用ArrayAdapter我可以使用ArrayAdapter更改但不使用SimpleCusrsor適配器。當我在簡單的遊標適配器中使用自己的textview時,它不顯示任何文本 –