我有一個應用程序,從數據庫中取出字符串,並將其放入ListView中。 這是從數據庫中獲取我的字符串代碼:TextView是ListView沒有正確顯示
public void setLogView(String date){
ArrayAdapter<TextView> adapter = new ArrayAdapter<TextView>(this, android.R.layout.simple_list_item_1);
listView.setAdapter(adapter);
DataBaseMain dataBase = new DataBaseMain(this);
dataBase.open();
String[][] all = dataBase.dayLog(date);
dataBase.close();
if(all == null)
return;
String temporay = "";
for(int j = 0; j < all[0].length; j++){
temporay = "";
for (int i = 0; i < all.length; i++){
TextView text = new TextView(this);
temporay = temporay + " " + all[i][j];
text.setText(temporay);
adapter.add((TextView)text);
}
}
}
它似乎,我在我的ListView獲得新的TextView但文字搞砸了。 我檢查了我的temporay
字符串,並沒有問題。 在某處把他放在ListView中。 logcat或異常中沒有錯誤。 這裏是我在我的應用程序的ListView insted的我想要的文字(我想把picutrue,但我沒有足夠的repetion:
你能分享一個截圖嗎你在等什麼你在看什麼 – CRUSADER 2013-05-08 06:10:39
我給你添加了聲望,所以你可以添加一張圖片 – Alex 2013-05-08 06:10:43
請添加截圖。 – 2013-05-08 06:31:03