If you’re using widget.newTableView(), then yes, you can set variable row height. In fact, that’s how it works by default (assuming you’re using the .722+ daily builds)
If you look closely at how the sample code works, the category rows (such as the one on the API page that says “Row #25” is actually just another row. It’s just set to be:
a. Shorter
b. A different color
c. Not be clickable
d. “isCategory = true”, which basically gives it that sorting property that causes it to “stick” to the top of the view if you scroll too far down.
[code]-- Create 100 rows, and two categories to the tableView:
for i=1,100 do
local rowHeight, rowColor, lineColor, isCategory
– make the 25th item a category
if i == 25 then
isCategory = true; rowHeight = 24; rowColor={ 70, 70, 130, 255 }; lineColor={0,0,0,255}
end
– make the 45th item a category as well
if i == 45 then
isCategory = true; rowHeight = 24; rowColor={ 70, 70, 130, 255 }; lineColor={0,0,0,255}
end
– function below is responsible for creating the row
list:insertRow{
onEvent=onRowTouch,
onRender=onRowRender,
height=rowHeight,
isCategory=isCategory,
rowColor=rowColor,
lineColor=lineColor
}
end[/code]
This is some of the sample code clipped right out of the API page. “rowHeight = x” is literally how you do it. The trick is that you set it here, in the row iterator stage, and not on the render stage. [import]uid: 41884 topic_id: 25937 reply_id: 104999[/import]