1
我有一个使用SimpleCursorAdapter从SQLite数据库填充的列表视图。其中一个在游标中返回的列是一个整数值0或1.在我的列表视图中,我想以更友好的形式(即“Yes”或“No”)显示它,并可能使用不同的文本颜色为每个。下面是我的源:Android应用程序,ListView中的条件文本
Cursor c = dbHelper.fetchAllItems();
startManagingCursor(c);
String[] from = {"deployed", "designation", "serial"};
int[] to = {R.id.deployed, R.id.designation, R.id.serial};
setListAdapter(new SimpleCursorAdapter(this, R.layout.list_item, c, from, to));
我将如何有条件开关元件和/或属性的布局时,SimpleCursorAdapter每个视图的列名映射简单。 (它是安全的假设,我不能使用SimpleCursorAdapter做到这一点?)
可能不应该使用simplecursoradapter。像这样使用simplecursoradapter并不意味着需要进行很多定制 – binnyb 2011-04-22 19:16:52