summaryrefslogtreecommitdiff
path: root/Juick
diff options
context:
space:
mode:
Diffstat (limited to 'Juick')
-rw-r--r--Juick/MessagesViewController.m9
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;
}