diff options
author | Vitaly Takmazov | 2013-12-11 03:25:26 +0400 |
---|---|---|
committer | Vitaly Takmazov | 2013-12-11 03:25:26 +0400 |
commit | ea49ada0ce84245896f78cfc9026b84df06f707c (patch) | |
tree | e1d7905777ec35c3e8df574ecb6b383fa513f0cd /Juick | |
parent | 78d6e25f674d083466e32051c26e8ee5ea840afe (diff) |
fix layout
Diffstat (limited to 'Juick')
-rw-r--r-- | Juick/MessagesViewController.m | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Juick/MessagesViewController.m b/Juick/MessagesViewController.m index 4beeb1c..92d4183 100644 --- a/Juick/MessagesViewController.m +++ b/Juick/MessagesViewController.m @@ -160,13 +160,15 @@ static NSString *CellIdentifier = @"MessageCell"; [cell bind:msg]; - cell.bodyLabel.preferredMaxLayoutWidth = tableView.bounds.size.width - (kLabelHorizontalInsets * 2.0f); - [cell setNeedsUpdateConstraints]; [cell updateConstraintsIfNeeded]; + [cell.contentView setNeedsLayout]; [cell.contentView layoutIfNeeded]; + cell.bodyLabel.preferredMaxLayoutWidth = CGRectGetWidth(cell.bodyLabel.frame); + [cell.contentView layoutIfNeeded]; + CGFloat height = [cell.contentView systemLayoutSizeFittingSize:UILayoutFittingCompressedSize].height; return height; @@ -174,6 +176,9 @@ static NSString *CellIdentifier = @"MessageCell"; - (CGFloat)tableView:(UITableView *)tableView estimatedHeightForRowAtIndexPath:(NSIndexPath *)indexPath { + if (self.dataLoading) { + return [self tableView:tableView heightForRowAtIndexPath:indexPath]; + } return 500.0f; } |