2011-11-26 77 views
0

我刚开始学习Objective c。现在,我想在“大”标题下标题(小灰色文本)。我使用的代码:xcode中的解释器

cell.detailTextLabel.text = @"Test"; 

但在模拟器中我看不到一个标题下。

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
    if (cell == nil) { 
     cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; 


    } 

    // Configure the cell... 
    cell.textLabel.text = [self.authorList objectAtIndex:[indexPath row]]; 

    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 

    return cell; 
} 

回答

2

您正在使用UITableViewCellStyleDefault。它不支持细节。

改为使用UITableViewCellStyleSubtitle

CNC中

如果您使用的故事板,除去所有的细胞初始化代码,只留下离队线。然后转到界面构建器并在那里更改单元格的类型。

+0

谢谢/ Dankjewel Tom :) – Blazer