Преглед изворни кода

improve device rotation behavior at the bottom of a chat

cyberta пре 4 година
родитељ
комит
4de4c185aa
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      deltachat-ios/Chat/ChatViewController.swift

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

@@ -306,14 +306,17 @@ class ChatViewController: UITableViewController {
                 if self.showCustomNavBar {
                     self.navigationItem.setRightBarButton(self.badgeItem, animated: true)
                 }
+                if lastSectionVisibleBeforeTransition {
+                    self.scrollToBottom(animated: false)
+                }
             },
             completion: {[weak self] _ in
                 guard let self = self else { return }
                 self.updateTitle(chat: self.dcContext.getChat(chatId: self.chatId))
                 if lastSectionVisibleBeforeTransition {
                     DispatchQueue.main.async { [weak self] in
-                        self?.scrollToBottom(animated: true)
                         self?.tableView.reloadData()
+                        self?.scrollToBottom(animated: false)
                     }
                 }
             }