2011-11-26 75 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