How can I divide a table cell into two p开发者_如何学Pythonarts?
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.
You can add simply 2 SubViews in to the cell and nest whatever you want inside.
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];
精彩评论