summaryrefslogtreecommitdiffhomepage
path: root/ios
diff options
context:
space:
mode:
authorAndrej Mihajlov <and@mullvad.net>2021-03-18 10:29:40 +0100
committerAndrej Mihajlov <and@mullvad.net>2021-03-22 16:36:14 +0100
commitbbac3298b5bde5e211db02b7c41bed1b83530c7e (patch)
tree56dfa4632bdf26059c8d8cbe7895328bb05df721 /ios
parent1b8e34bd64cc6c7029bf33b993cf121c449a8064 (diff)
downloadmullvadvpn-bbac3298b5bde5e211db02b7c41bed1b83530c7e.tar.xz
mullvadvpn-bbac3298b5bde5e211db02b7c41bed1b83530c7e.zip
RootContainer: Fix additionalSafeAreaInsets calculation
Take into account view's safeAreaInsets when calculating additionalSafeAreaInsets.
Diffstat (limited to 'ios')
-rw-r--r--ios/MullvadVPN/RootContainerViewController.swift4
1 files changed, 2 insertions, 2 deletions
diff --git a/ios/MullvadVPN/RootContainerViewController.swift b/ios/MullvadVPN/RootContainerViewController.swift
index 465fff6f1e..9a3fa411fa 100644
--- a/ios/MullvadVPN/RootContainerViewController.swift
+++ b/ios/MullvadVPN/RootContainerViewController.swift
@@ -377,8 +377,8 @@ class RootContainerViewController: UIViewController {
/// Updates additional safe area insets to push the child views below the header bar
private func updateAdditionalSafeAreaInsetsIfNeeded() {
- // Reset top inset if header bar is invisible
- let insetTop = headerBarHidden ? 0 : headerBarView.frame.height
+ let offsetTop = view.safeAreaInsets.top - additionalSafeAreaInsets.top
+ let insetTop = headerBarHidden ? 0 : headerBarView.frame.height - offsetTop
if additionalSafeAreaInsets.top != insetTop {
additionalSafeAreaInsets.top = insetTop