]> git.ipfire.org Git - thirdparty/wireguard-apple.git/commitdiff
Settings: account for bottom padding on iPhone X
authorJason A. Donenfeld <Jason@zx2c4.com>
Mon, 5 Nov 2018 01:09:40 +0000 (02:09 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Mon, 5 Nov 2018 01:09:40 +0000 (02:09 +0100)
Reported-by: Jeffrey A. Donenfeld <jad@runblue.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
WireGuard/WireGuard/UI/iOS/SettingsTableViewController.swift

index badb5714fc10c8301990933504a321341595ba61..6bfad9256b947b4beb406004bb6e2a9b655217fd 100644 (file)
@@ -47,15 +47,15 @@ class SettingsTableViewController: UITableViewController {
         logo.frame = CGRect(x: 0, y: 0, width: width, height: height)
         logo.bounds = logo.frame.insetBy(dx: 2, dy: 2)
         self.tableView.tableFooterView = logo
-
     }
+
     override func viewDidLayoutSubviews() {
         super.viewDidLayoutSubviews()
         guard let logo = self.tableView.tableFooterView else { return }
-        let fullHeight = max(self.tableView.contentSize.height, self.tableView.bounds.size.height - self.tableView.layoutMargins.top)
+        let bottomPadding = max(self.tableView.layoutMargins.bottom, CGFloat(10))
+        let fullHeight = max(self.tableView.contentSize.height, self.tableView.bounds.size.height - self.tableView.layoutMargins.top - bottomPadding)
         let e = logo.frame
-        let padding = CGFloat(10)
-        logo.frame = CGRect(x: e.minX, y: fullHeight - e.height - padding, width: e.width, height: e.height)
+        logo.frame = CGRect(x: e.minX, y: fullHeight - e.height, width: e.width, height: e.height)
     }
 
     @objc func doneTapped() {