better resize

This commit is contained in:
Benjamin Reis 2018-05-03 14:45:12 +02:00
parent d266c4f284
commit b64b6fc441

View file

@ -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<UIViewControllerTransitionCoordinator>)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 {