浏览代码

fix disappearing and reappearing of the message input bar on scroll down in a chat

cyberta 4 年之前
父节点
当前提交
cce59d47ff
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      deltachat-ios/Chat/ChatViewController.swift

+ 5 - 1
deltachat-ios/Chat/ChatViewController.swift

@@ -169,7 +169,11 @@ class ChatViewController: UITableViewController {
     }
 
     @objc func keyboardDidShow(_ notification: Notification) {
-        isKeyboardShown = true
+        if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue {
+            if keyboardSize.height > tableView.inputAccessoryView?.frame.height ?? 0 {
+                isKeyboardShown = true
+            }
+        }
     }
 
     @objc func keyboardWillShow(_ notification: Notification) {