2012-02-20 3 views
0

я изменить стиль ячейки, чтобы Subtile в инспекторе, но до сих пор нет субтитров, просто пустой, но название отображается здесь раздел в контроллере представления:Таблица Клеточные субтитры не отображающие

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; 
{ 

UITableViewCell *cell = nil; 

cell = [tableView dequeueReusableCellWithIdentifier:@"homeworkcell"]; 

if(cell == nil) 
{ 
    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"homeworkcell"]; 

} 
cell.textLabel.text = [tabledata objectAtIndex:indexPath.row]; 
cell.detailTextLabel.text = [tablesubtitles objectAtIndex:indexPath.row]; 
cell.textLabel.font = [UIFont systemFontOfSize:14.0]; 

//static NSString *CellIdentifier = @"Cell"; 

    /* if (cell == nil) { 
    cell = [[UITableViewCell alloc] 
      initWithStyle:UITableViewCellStyleSubtitle 
      reuseIdentifier:CellIdentifier]; 
    }*/ 

// Configure the cell. 
//-----------------------------------------START----------------------------Set image of cell---- 
    cellImage = [UIImage imageNamed:@"checkboxblank.png"]; 

cell.imageView.image = cellImage; 

//--------------------------------------------END---------------------------end set image of cell-- 

return cell; 

} 

ответ

5

Вам нужно используйте UITableViewCellStyleSubtitle, когда вы создадите новый UITableViewCell, а не UITableViewCellStyleDefault. UITableViewCellStyleDefault показывает только textLabel в ячейке, а не detailTextLabel.

См. Раздел «Элементы ячеек» ссылки UITableViewCell и «Стандартные стили для ячеек таблицы» в файле Table View Programming Guide.

+0

удивительный, спасибо большое – user1191343

Смежные вопросы