diff --git a/Classes/ChatConversationImdnView.m b/Classes/ChatConversationImdnView.m index 49b58ec25..9ce5f031b 100644 --- a/Classes/ChatConversationImdnView.m +++ b/Classes/ChatConversationImdnView.m @@ -54,17 +54,9 @@ static UICompositeViewDescription *compositeDescription = nil; _msgBackgroundColorImage.image = _msgBottomBar.image = [UIImage imageNamed:(outgoing ? @"color_A.png" : @"color_D.png")]; _msgDateLabel.textColor = [UIColor colorWithPatternImage:_msgBackgroundColorImage.image]; - [_msgView setFrame:CGRectMake(_msgView.frame.origin.x, - _msgView.frame.origin.y, - _msgView.frame.size.width, - [UIChatBubbleTextCell ViewHeightForMessage:_msg withWidth:self.view.frame.size.width].height)]; _tableView.delegate = self; _tableView.dataSource = self; - [_tableView setFrame:CGRectMake(_tableView.frame.origin.x, - _msgView.frame.origin.y + _msgView.frame.size.height + 10, - _tableView.frame.size.width, - self.view.frame.size.height - (_msgView.frame.origin.y + _msgView.frame.size.height))]; _displayedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDisplayed); _receivedList = linphone_chat_message_get_participants_by_imdn_state(_msg, LinphoneChatMessageStateDeliveredToUser); @@ -74,7 +66,7 @@ static UICompositeViewDescription *compositeDescription = nil; [_tableView reloadData]; } -- (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id)coordinator { +- (void)fitContent { BOOL outgoing = linphone_chat_message_is_outgoing(_msg); _msgBackgroundColorImage.image = _msgBottomBar.image = [UIImage imageNamed:(outgoing ? @"color_A.png" : @"color_D.png")]; _msgDateLabel.textColor = [UIColor colorWithPatternImage:_msgBackgroundColorImage.image]; @@ -89,6 +81,10 @@ static UICompositeViewDescription *compositeDescription = nil; self.view.frame.size.height - (_msgView.frame.origin.y + _msgView.frame.size.height))]; } +- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation { + [self fitContent]; +} + #pragma mark - TableView - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {