[英]how can i put the second line in the table view cell in objective-c?
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. 其中dataarray1是以下数组。
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? 您是否尝试过使用
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
您正在寻找的样式是
UITableViewCellStyleSubtitle
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.