0
我正在開發Android應用程序。在這個應用程序中,我有報告的窗口。報告窗口將包含具有字段名稱,金額和日期的表格。這些數據將來自數據庫。所以在while循環中,我創建了標籤和tableViewRow。但它沒有工作和給出錯誤。在運行時在Titanium中創建表視圖和表視圖行時出現問題?
這是使用代碼蔭:
var rows = conn.execute('SELECT * FROM entries WHERE 1 order by dt desc ');
var i = 0;
var k = 0;
var l = 0;
var j = 1;
while (rows.isValidRow())
{
var repLabel[i] = Titanium.UI.createLabel({
text:rows.fieldByName('name'),
left:10,
textAlign:'center',
font:{ fontSize:16,fontFamily:'helvetica',fontWeight:'bold' },
color:'#999'
});
var repLabel[k] = Titanium.UI.createLabel({
text:rows.fieldByName('amount'),
left:150,
textAlign:'center',
font:{ fontSize:16,fontFamily:'helvetica',fontWeight:'bold' },
color:'#999'
});
var repLabel[l] = Titanium.UI.createLabel({
text:rows.fieldByName('date'),
left:230,
textAlign:'center',
font:{ fontSize:16,fontFamily:'helvetica',fontWeight:'bold' },
color:'#999'
});
var repRow[i] = Titanium.UI.createTableViewRow({
backgroundColor:'#fff',
});
repRow[i].add(repLabel[i]);
repRow[i].add(repLabel[k]);
repRow[i].add(repLabel[l]);
data[j] = repRow[i];
rows.next();
i++;
j++;
};
它給出了什麼錯誤,請將它們發佈。 – bh88 2011-04-28 05:40:56