我有一个应用程序,从数据库中取出字符串,并将其放入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