I have got a problem in my project. My project is a little bit complex, so I use the ListView3 project as a example in the official Sample Apps code ListView3 just in the CoronaSDK Package.
The code below is existed in the ListView3 project.
–Create Table view
local list = widget.newTableView{
width = 320,
height = 448,
bottomPadding = 8,
hideBackground = true,
maskFile = “mask-320x448.png”
}
–Handle row rendering
local function onRowRender( event )
local row = event.row
local rowGroup = event.view
local label = "List item "
local color = 255
–Create the row’s text
row.textObj = display.newRetinaText( rowGroup, label … row.index, 0, 0, native.systemFontBold, 16 )
row.textObj:setTextColor( color )
row.textObj:setReferencePoint( display.CenterLeftReferencePoint )
row.textObj.x, row.textObj.y = 20, rowGroup.contentHeight * 0.5
rowGroup:insert( row.textObj )
–Create the row’s arrow
row.arrow = display.newImage( “rowArrow.png”, false )
row.arrow.x = rowGroup.contentWidth - row.arrow.contentWidth * 2
row.arrow.y = rowGroup.contentHeight * 0.5
rowGroup:insert( row.arrow )
end
Above code works well in the beginning, but if I do something and change the code to below:
–Create Table view
local list = widget.newTableView{
width = 320,
height = 448,
bottomPadding = 8,
hideBackground = true,
noLines = true,
maskFile = “mask-320x448.png”
}
–Handle row rendering
local function onRowRender( event )
local row = event.row
local rowGroup = event.view
local label = "List item "
local color = 255
--Create the row’s text
– row.textObj = display.newRetinaText( rowGroup, label … row.index, 0, 0, native.systemFontBold, 16 )
– row.textObj:setTextColor( color )
– row.textObj:setReferencePoint( display.CenterLeftReferencePoint )
– row.textObj.x, row.textObj.y = 20, rowGroup.contentHeight * 0.5
– rowGroup:insert( row.textObj )
--Create the row’s arrow
row.arrow = display.newImage( “rowArrow.png”, false )
row.arrow.x = rowGroup.contentWidth - row.arrow.contentWidth * 2
row.arrow.y = rowGroup.contentHeight * 0.5
rowGroup:insert( row.arrow )
end
Yes, I add a line in the first function
noLines = true,
and i comment the textObj to disappear the row’s text.
The result I want is just display the arrow picture, but the truth is the arrow picture is missing too.
And if I remove this code: noLines = true, the arrow will display right way.
Or if the the textObj exist even the text is “”, the arrow will display too.
My goal is disappear the Line and display the arrow.
Thanks for your time.
Good day to everyone.