Quellcode durchsuchen

Merge pull request #1736 from deltachat/account_switch_layout_improvements

AccountSwitchViewController layout improvements
cyBerta vor 2 Jahren
Ursprung
Commit
2a9cb00943
1 geänderte Dateien mit 14 neuen und 6 gelöschten Zeilen
  1. 14 6
      deltachat-ios/Controller/AccountSwitchViewController.swift

+ 14 - 6
deltachat-ios/Controller/AccountSwitchViewController.swift

@@ -62,6 +62,10 @@ class AccountSwitchViewController: UITableViewController {
         navigationItem.setRightBarButton(doneButton, animated: false)
     }
 
+    override func viewDidAppear(_ animated: Bool) {
+        tableView.bounces = tableView.contentSize.height > tableView.safeAreaLayoutGuide.layoutFrame.height
+    }
+
     private func setupSubviews() {
         title = String.localized("switch_account")
         tableView.register(AccountCell.self, forCellReuseIdentifier: AccountCell.reuseIdentifier)
@@ -112,15 +116,19 @@ class AccountSwitchViewController: UITableViewController {
             }
             return 12
         }
-        return 0
+        return CGFloat.leastNormalMagnitude
+    }
+
+    override func tableView(_ tableView: UITableView, heightForFooterInSection section: Int) -> CGFloat {
+        return CGFloat.leastNormalMagnitude
     }
 
     override func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
-        if section == addSection {
-            let view = UIView()
-            return view
-        }
-        return nil
+        return  UIView()
+    }
+
+    override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
+        return  UIView()
     }
 
     func selectAccount(previousAccountId: Int, accountId: Int, cell: UITableViewCell) {