开发者

how to add a subtext to a table cell?

开发者 https://www.devze.com 2022-12-13 12:19 出处:网络
开发者_JS百科i have created a table view which displays database fields.i need to add a sub-label and a subtext to each cell in which i can display other database fields. need help..So you want the ma
开发者_JS百科

i have created a table view which displays database fields.i need to add a sub-label and a subtext to each cell in which i can display other database fields. need help..


So you want the main text, and a subtitle. Like in the music app? If that's what you want, you want to set the style of the TableView to "UITableViewCellStyleSubtitle". And then the way to set the main label;

cellName.textLabel.text = @"label text"

And to set the subtitle;

cellName.detailTextLabel.text = @"subtitle text".


Add UILabel in the cell and assign text. you can add control in table view cell.


You could look at the three20 framework. It has a rich set of tablecell designs. Might be an overkill, but it as some other good stuff in too.

0

精彩评论

暂无评论...
验证码 换一张
取 消