mirror of
https://github.com/MessageKit/MessageKit.git
synced 2026-02-06 19:03:19 +00:00
Merge pull request #174 from etoledom/fix/scrollIndicatorInset
Fix scroll indicator inset
This commit is contained in:
@@ -81,6 +81,7 @@ open class MessagesViewController: UIViewController {
|
||||
if isFirstLayout {
|
||||
addKeyboardObservers()
|
||||
messagesCollectionView.contentInset.bottom = messageInputBar.frame.height
|
||||
messagesCollectionView.scrollIndicatorInsets.bottom = messageInputBar.frame.height
|
||||
isFirstLayout = false
|
||||
}
|
||||
}
|
||||
@@ -274,11 +275,15 @@ extension MessagesViewController {
|
||||
|
||||
if (keyboardEndFrame.origin.y + keyboardEndFrame.size.height) > view.frame.size.height {
|
||||
// Hardware keyboard is found
|
||||
messagesCollectionView.contentInset.bottom = view.frame.size.height - keyboardEndFrame.origin.y
|
||||
let bottomInset = view.frame.size.height - keyboardEndFrame.origin.y
|
||||
messagesCollectionView.contentInset.bottom = bottomInset
|
||||
messagesCollectionView.scrollIndicatorInsets.bottom = bottomInset
|
||||
|
||||
} else {
|
||||
//Software keyboard is found
|
||||
let bottomInset = keyboardEndFrame.height > messageInputBar.frame.height ? keyboardEndFrame.height : messageInputBar.frame.height
|
||||
messagesCollectionView.contentInset.bottom = bottomInset
|
||||
messagesCollectionView.scrollIndicatorInsets.bottom = bottomInset
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user