[Android] MultiColumn ListView in Android

MultiColumn ListView in Android

http://www.heikkitoivonen.net/blog/2009/02/15/multicolumn-listview-in-android/

當我們在開發 Android Application 時,如果需要多個 column,便可採用這個作法。

比較關鍵的是這幾行敘述,可以讓多個欄位直接橋接到 ListView 上。

mSchedule = new SimpleAdapter(this, 
mylist,
R.layout.row,
new String[] {"train", "from", "to"},
new int[] {R.id.TRAIN_CELL, R.id.FROM_CELL, R.id.TO_CELL});
list.setAdapter(mSchedule);

詳情可以再參考該網頁。

發佈留言