开发者

how can i put the second line in the table view cell in objective-c?

开发者 https://www.devze.com 2022-12-20 18:07 出处:网络
I am using the following code to add the next line in the same same but i am not getting the output. cell.detailTextLabel.text= [self.dataArray1 objectAtIndex:indexPath.row];

I am using the following code to add the next line in the same same but i am not getting the output.

cell.detailTextLabel.text= [self.dataArray1 objectAtIndex:indexPath.row];

where dataarray1 is the following array.

self.dataArray1 = [NSArray arrayWithObjects:@"sugar :   1 teaspoon", @"salt  :   1 teaspoon",@"sugar  :   1 teaspoon", @"salt  :   1 teaspoon",@"sugar  :   1 teaspoon", @"salt  :   1 teaspoon",@"sugar :   1 teaspoon"开发者_如何学编程, @"salt  :   1 teaspoon",nil];

how can i add the more content in the same cell of table view.


Have you tried using the UITableViewCellStyleSubtitle UITableViewCellStyle? I'm guessing that the style you're using might not support the detail text.


You have to set the style of the cell when you init it for it to show the detail text.

- (id)initWithStyle:(UITableViewCellStyle)stylereuseIdentifier:(NSString *)reuseIdentifier

the style you are looking for is UITableViewCellStyleSubtitle

0

精彩评论

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