2017-04-22 3 views
0

iOS 앱을 쓰고 있습니다. 사용자가 영화 검색 키워드를 입력하면 omdbapi.com에서 데이터를 가져 와서 영화를 tableview에 표시합니다. 테이블보기 셀이 제대로 표시되지 않습니다.TableViewCell 자동 높이 문제

프로젝트 URL은 : project on onedrive

나는 그것의 작동하지 않는, 모든 자동 레이아웃 방법을 사용하려고했지만.

override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 
     return UITableViewAutomaticDimension; 

    } 
+0

확인이 게시물의 의지 http://stackoverflow.com/questions/40293336/uitableviewautomaticdimension-not-working-for-resizing-cell-height/40300589#40300589 – Joe

+0

당신이 ATIF Shabeer –

+0

확인이 @ 당신의 결과 이미지를 게시 할 수 있습니다 out http://stackoverflow.com/a/43556505/3236890 – dip

답변

0

테이블 높이에 대한 추정 방법도 설정해야합니다. 높이 계산을 위해 이러한 방법을 배치하고 셀 제한을 확인하십시오.

func tableView(_ tableView: UITableView, estimatedHeightForRowAt indexPath: IndexPath) -> CGFloat { 
    return UITableViewAutomaticDimension 
} 

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat { 
    return UITableViewAutomaticDimension 
    } 

희망이 도움이 될 것입니다.