Objective c UITableView字幕未出现
我有一个简单的代码:Objective c UITableView字幕未出现,objective-c,ios,uitableview,Objective C,Ios,Uitableview,我有一个简单的代码: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifie
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
cell.accessoryType=UITableViewCellAccessoryDetailDisclosureButton;
}
// Configure the cell...
NSString *subtitle = [NSString stringWithString: @"All about the color "];
cell.detailTextLabel.text=subtitle;
cell.textLabel.text = [authorList objectAtIndex: [indexPath row]];
return cell;
}
问题是我的字幕没有出现。我做错了什么。请帮助。谢谢。您必须选择其他单元格样式,请查看文档: UITableViewCellStyleDefault 简单的 带有文本标签的单元格的样式 (黑色和左对齐)和 可选图像视图。请注意,这是 之前的单元格的默认样式 iOS 3.0 我想你想要的是: UITableViewCellStyleSubtitle 风格 对于具有左对齐标签的单元格 穿过顶部,左对齐 以较小的灰色文本在其下方添加标签。 iPod应用程序在应用程序中使用单元格 这种款式 您可以参考《iOS表视图编程指南》一章,查看样式及其外观的概述