在我電暈的項目,我想顯示在表文本框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幫助,當你說「數據可用的行」,你是什麼意思來解決這個問題