diff --git a/Classes/ChatRoomTableViewController.m b/Classes/ChatRoomTableViewController.m index 1234b40a6..85eecc9d7 100644 --- a/Classes/ChatRoomTableViewController.m +++ b/Classes/ChatRoomTableViewController.m @@ -93,12 +93,10 @@ } - (void)scrollToBottom:(BOOL)animated { - CGSize size = [self.tableView contentSize]; - CGRect bounds = [self.tableView bounds]; - bounds.origin.y = size.height - bounds.size.height; - - [self.tableView.layer removeAllAnimations]; - [self.tableView scrollRectToVisible:bounds animated:animated]; + [self.tableView reloadData]; + [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:([data count] - 1) inSection:0] + atScrollPosition:UITableViewScrollPositionBottom + animated:YES]; } - (void)scrollToLastUnread:(BOOL)animated { diff --git a/Classes/ChatRoomViewController.m b/Classes/ChatRoomViewController.m index 3043211e4..2a370e117 100644 --- a/Classes/ChatRoomViewController.m +++ b/Classes/ChatRoomViewController.m @@ -355,9 +355,9 @@ static void message_status(LinphoneChatMessage* msg,LinphoneChatMessageState sta [chat setState:[NSNumber numberWithInt:1]]; //INPROGRESS [chat create]; [tableController addChatEntry:chat]; - [tableController scrollToBottom:TRUE]; + [tableController scrollToBottom:true]; [chat release]; - + LinphoneChatMessage* msg = linphone_chat_room_create_message(chatRoom, [message UTF8String]); linphone_chat_message_set_user_data(msg, [chat retain]); if(externalUrl) {