venkat
venkat

Reputation: 345

Dividing a table cell into two parts

How can I divide a table cell into two parts?

Upvotes: 0

Views: 1948

Answers (3)

EXC_BAD_ACCESS
EXC_BAD_ACCESS

Reputation: 2707

As told by shani, Create two subview with its frame and add them on the cell. Here I will show sample structure,

UITableViewCell *cell  = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"cell"];
UILabel *label1=//create a label1 with frame
UILabel *label2=//create a label2 with frame
[cell.contentView  addSubview:label1];
[cell.contentView  addSubview:label2];

Upvotes: 0

sole007
sole007

Reputation: 727

A table cell is bydefault divided in three sections, the image on the left, the text labels in the center and the accessory view on the right. If u want more divisions or customize them, you have to customize the table cell by inheriting the UITableViewCell.

Upvotes: 1

shannoga
shannoga

Reputation: 19869

You can add simply 2 SubViews in to the cell and nest whatever you want inside.

Upvotes: 0

Related Questions