I’m using the new tableview (widget 2.0) and have problems getting a transparent background:
[lua]
function scene:createScene( event )
local group = self.view
– BG IMAGE
Background = display.newImage(“images/leaderboard.jpg”)
group:insert(Background)
local Exit = function(event)
if event.phase == “ended” then
audio.play ( Click )
storyboard.gotoScene( “menu”, “fade”, 400 )
end
end
local ExitButton = widget.newButton{
left = _W/2,
top = 940,
defaultFile = “images/btnExit.png”,
overFile = “images/btnExitS.png”,
onRelease = Exit
}
ExitButton.x = _W/2
group:insert(ExitButton)
– onRender listener for the tableView
local function onRowRender( event )
local row = event.row
local rowTitle = display.newText( row, "Row " … row.index … “…123456789012345678901234567890”, 0, 0, nil, 25 )
rowTitle:setReferencePoint( display.CenterLeftReferencePoint )
rowTitle.y = row.contentHeight * 0.5
end
– Create a tableView
local tableView = widget.newTableView
{
left = 115,
top = 315,
width = 550,
height = 550,
noLines = true,
maskFile = “mask.png”,
onRowRender = onRowRender,
onRowTouch = onRowTouch
}
group:insert( tableView )
for i = 1, 100 do
local rowHeight, rowColor, lineColor, isCategory
local isCategory = false
– function below is responsible for creating the row
– Insert the row into the tableView
tableView:insertRow
{
isCategory = isCategory,
rowHeight = 40,
rowColor = { 255, 255, 255, 0 },
}
end
end
[/lua]
All I see is a white square (the size of the mask.png. When i click an item i can see it, but i can’t get the background to be transparent.
The mask is 554 x 554 with a 4 pixel black border around it.
When I remove ‘height’ from the tableview options, all of a sudden the background is transparent, but the scrollable height is only 2 lines.
What am i doing wrong?