Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add a subtext to a table cell?

Tags:

iphone

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..

like image 809
dpaksp Avatar asked Dec 05 '09 06:12

dpaksp


2 Answers

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".

like image 125
Pudgeball Avatar answered Oct 23 '22 17:10

Pudgeball


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

like image 1
Brij Avatar answered Oct 23 '22 18:10

Brij