동적 표보기 셀이있는 tableview (B)가있는 모든 사용자 정의 셀에 tableview (A)가 있습니다.동적 셀의 표보기 설정 표보기 높이 구속에 대한 콘텐츠 높이 ios
at tableview (A) cellForRowAtIndex.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
MainMessageTVCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MsgMainCell"];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
NSInteger index = indexPath.row;
MessageMain *result = tableData[index];
cell.dateLabelTC.text = [NSString stringWithFormat:@"Date : %@",result.createdTime];
cell.subjectLabelTC.text = [NSString stringWithFormat:@"Subject : %@",result.subject];
NSArray *arrList = result.messageList;
[cell setupTableData:(NSMutableArray *)arrList];
[cell setNeedsUpdateConstraints];
}
테이블 뷰 (A)의 사용자 정의 셀 재로드 테이블 뷰 (B)에서.
-(void)setupTableData:(NSMutableArray *)tableData{
_tableData = tableData;
[self.tableView reloadData];
}
-(void)updateConstraints{
[super updateConstraints];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView layoutIfNeeded];
CGFloat height = self.tableView.contentSize.height;//+1000;
tableBHeightConstraints.constant = height;
});
}
tableBHeightConstraints의 tableview는 (A)에 테이블 뷰 (B)의 셀의 아이의 높이를 제한한다. tableBHeightConstraints.constant가 모든 계산 제약 조건에서 올바른 값을 가져 오지 않습니다.
동적 테이블 셀의 높이를 설정 한 후 tableView.contentSize.height를 정확히 얻는 가장 좋은 장소 또는 방법은 무엇입니까?
이있는 tableview (A)이다의 셀
이 (B)의 tableview이다 '.
동적 셀이 있고 머리글과 바닥 글을 가지고 있기 때문에 전체 테이블 내용 높이를 얻는 방법. –