Does anybody know how to wrap the text in a listview?
I am trying this code:
data[1] = {}
data[1].title = "Hot Coffee"
data[1].subtitle = "This is a really long text that I want to wrap but it does´t work.........HELP ME!!"
myList = tableView.newList{
data=data,
default="listItemBg.png",
over="listItemBg\_over.png",
onRelease=listButtonRelease,
top=topBoundary,
bottom=bottomBoundary,
callback = function( row )
local g = display.newGroup()
local img = display.newImage(row.image)
g:insert(img)
img.x = math.floor(img.width\*0.5 + 6)
img.y = math.floor(img.height\*0.5)
local title = display.newText( row.title, 0, 0, native.systemFontBold, 14 )
title:setTextColor(0, 0, 0)
--title:setTextColor(255, 255, 255)
g:insert(title)
title.x = title.width\*0.5 + img.width + 6
title.y = 30
This is the text that I would like to wrap:
local subtitle = display.newText( row.subtitle, 0, 0, native.systemFont, 12 )
subtitle:setTextColor(80,80,80)
g:insert(subtitle)
subtitle.x = subtitle.width\*0.5 + img.width + 6
subtitle.y = title.y + title.height + 6
return g
end
}
I have tried several of the examples that I had found in the code exchange and forum.
Maholm
[import]uid: 5717 topic_id: 21213 reply_id: 321213[/import]