在我电晕的项目,我想显示在表文本框row.Here的代码,它仅显示一个文本框,我想表明的数据可用行文本字段。在表行添加文本框 - 科罗娜SDK
local function onRowRender(event)
local phase = event.phase
local row = event.row
local itemObj = GetItemDetails(row.index);
local txt = itemObj.itemName;
if(#txt > 25) then
txt = string.sub(txt,1,25);
txt = txt.."..";
end
local rowTitle = display.newText(row, "\t"..txt, 0, 0, "impact", 14)
if(deviceName == "iPhone" or deviceName == "iPad") then
rowTitle.x = row.x - (row.contentWidth * 0.5) + (rowTitle.contentWidth * 0.5)
else
rowTitle.x = row.x - (row.contentWidth * 0.5) + (rowTitle.contentWidth * 0.5)+15
end
rowTitle.y = row.contentHeight * 0.5
rowTitle:setTextColor(98, 71, 24)
local rowqtytxt=nil;
if(deviceName == "iPhone" or deviceName == "iPad") then
rowqtytxt= native.newTextField(0, 0,32, 32 ,onSubmitted);
rowqtytxt.x = 125;
rowqtytxt.hasBackground = false;
--rowqtytxt:addEventListener("userInput", textListener)
rowqtytxt.size = 32;
else
rowqtytxt = native.newTextField(0, 0,32, 32 ,onSubmitted);
rowqtytxt.x = 207;
rowqtytxt.hasBackground = false;
-- rowqtytxt:addEventListener("userInput", textListener)
rowqtytxt.size = 32;
end
rowqtytxt.y = row.contentHeight * 0.5
rowqtytxt:setTextColor(98, 71, 24)
return true;
end
上面的代码只显示一个文本field.Please帮助,当你说“数据可用的行”,你是什么意思来解决这个问题