Jelajahi Sumber

prevent initial flashing of the scroll down button when entering a chat

cyberta 4 tahun lalu
induk
melakukan
4501dd1984

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

@@ -529,6 +529,7 @@ class ChatViewController: UITableViewController {
 
 
     override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
     override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
         _ = handleUIMenu()
         _ = handleUIMenu()
+        messageInputBar.scrollDownButton.isHidden = isInitial || isLastRowVisible()
 
 
         let id = messageIds[indexPath.row]
         let id = messageIds[indexPath.row]
         if id == DC_MSG_ID_DAYMARKER {
         if id == DC_MSG_ID_DAYMARKER {
@@ -601,8 +602,6 @@ class ChatViewController: UITableViewController {
                     showAvatar: showAvatar,
                     showAvatar: showAvatar,
                     showName: showName)
                     showName: showName)
 
 
-        messageInputBar.scrollDownButton.isHidden = isLastRowVisible()
-
         return cell
         return cell
     }
     }
 
 

+ 1 - 0
deltachat-ios/Chat/Views/ChatInputBar.swift

@@ -15,6 +15,7 @@ public class ChatInputBar: InputBarAccessoryView {
         let button = UIButton(frame: .zero)
         let button = UIButton(frame: .zero)
         button.translatesAutoresizingMaskIntoConstraints = false
         button.translatesAutoresizingMaskIntoConstraints = false
         button.addTarget(self, action: #selector(onScrollDownPressed), for: .touchUpInside)
         button.addTarget(self, action: #selector(onScrollDownPressed), for: .touchUpInside)
+        button.isHidden = true
         return button
         return button
     }()
     }()