2016-11-03 3 views
1

셀에 대해 자막 스타일을 설정했지만 detailTextLabel은 아직 표시되지 않았습니다.detailTextLabel이 셀에 표시되지 않습니다. 3

let cellIdentifier = "homeFeedItem" 
let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier) ?? UITableViewCell(style: .subtitle,  reuseIdentifier: cellIdentifier) 
cell.textLabel?.text = self.arrItems[indexPath.row]["title"] 
cell.detailTextLabel?.text = self.arrItems[indexPath.row]["desc"] 
cell.imageView?.image = UIImage(named: self.arrItems[indexPath.row]["icon"]!) 

나는 self.arrItems [indexPath.row] [ "desc"]를 인쇄 해 보았습니다. 괜찮아. 제발 도와주세요.

+0

인터페이스 작성기에서 스타일을 설정 했습니까? 'dequeueReusableCell (withIdentifier : forIndexPath :) '메소드를 사용하면 항상 유효하지 않은 재사용 셀을 얻을 수 있습니다. 답장을 보내 주셔서 감사합니다. – vadian

+0

프로그래밍 방식으로 설정했습니다. –

+0

프로그래밍 방식으로 설정 한 경우 - 내가 더 복잡한 이유를 이해하지 못하는 경우 - 모든 셀의 스타일이 각각 설정되어 있는지 확인해야합니다. – vadian

답변

0

괜찮아. 알았어. 원래는 Scott Berrevoets

에 따르면 SO post에 따르면, UITableViewCell을 등록하면 모든 셀이 기본 스타일로 인스턴스화됩니다. 자막 및 오른쪽 및 왼쪽 세부 셀은 registerClass : forCellReuseIdentifier :와 함께 사용할 수 없습니다.

+0

물론 모든 것을 설정합니다. –

관련 문제