mirror of
https://github.com/vector-im/element-ios.git
synced 2024-10-01 00:32:41 +00:00
Should fix SYIOS-61 - Chat room : cannot scroll to bottom when keyboard is opened whereas the growing textview contains multi-lines text.
This commit is contained in:
parent
7ffcd500f2
commit
03922c5f53
1 changed files with 14 additions and 6 deletions
|
@ -1395,13 +1395,18 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UIEdgeInsets insets = self.messagesTableView.contentInset;
|
CGFloat keyboardHeight = (endRect.origin.y == 0) ? endRect.size.width : endRect.size.height;
|
||||||
// Handle portrait/landscape mode
|
|
||||||
insets.bottom = (endRect.origin.y == 0) ? endRect.size.width : endRect.size.height;
|
|
||||||
|
|
||||||
// bottom view offset
|
// bottom view offset
|
||||||
// Don't forget the offset related to tabBar
|
// Don't forget the offset related to tabBar
|
||||||
CGFloat nextBottomViewContanst = insets.bottom - [AppDelegate theDelegate].masterTabBarController.tabBar.frame.size.height;
|
CGFloat nextBottomViewContanst = keyboardHeight - [AppDelegate theDelegate].masterTabBarController.tabBar.frame.size.height;
|
||||||
|
|
||||||
|
// the tableview bottom inset must also be updated
|
||||||
|
UIEdgeInsets insets = self.messagesTableView.contentInset;
|
||||||
|
// insets.bottom is the bottom part of the tableview content size which is not displayed
|
||||||
|
// The bottom margin is equal to the keyboard height + controlview part which is greather than the tableview bottom margin.
|
||||||
|
// The tableview bottom margin has the same value as the defauft bottom view height;
|
||||||
|
insets.bottom = keyboardHeight + self.controlView.frame.size.height - defaultMessagesTableViewBottomConstraint;
|
||||||
|
|
||||||
// get the animation info
|
// get the animation info
|
||||||
NSNumber *curveValue = [[notif userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey];
|
NSNumber *curveValue = [[notif userInfo] objectForKey:UIKeyboardAnimationCurveUserInfoKey];
|
||||||
|
@ -1483,7 +1488,10 @@ NSString *const kCmdResetUserPowerLevel = @"/deop";
|
||||||
}
|
}
|
||||||
|
|
||||||
UIEdgeInsets insets = self.messagesTableView.contentInset;
|
UIEdgeInsets insets = self.messagesTableView.contentInset;
|
||||||
insets.bottom = self.controlView.frame.size.height;
|
// insets.bottom is the bottom part of the tableview content size which is not displayed
|
||||||
|
// The bottom margin is equal to the tabbar height + controlview part which is greather than the tableview bottom margin.
|
||||||
|
// The tableview bottom margin has the same value as the defauft bottom view height.
|
||||||
|
insets.bottom = [AppDelegate theDelegate].masterTabBarController.tabBar.frame.size.height + (self.controlView.frame.size.height - defaultMessagesTableViewBottomConstraint);
|
||||||
|
|
||||||
isKeyboardDisplayed = NO;
|
isKeyboardDisplayed = NO;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue