diff --git a/iphone/Maps/UI/PlacePage/PlacePageViewController.swift b/iphone/Maps/UI/PlacePage/PlacePageViewController.swift index 95e0442907..977c3778d5 100644 --- a/iphone/Maps/UI/PlacePage/PlacePageViewController.swift +++ b/iphone/Maps/UI/PlacePage/PlacePageViewController.swift @@ -75,7 +75,8 @@ final class PlacePageScrollView: UIScrollView { actionBarContainerView.layer.masksToBounds = true actionBarContainerView.layer.maskedCorners = [.layerMinXMaxYCorner, .layerMaxXMaxYCorner] - if previousTraitCollection == nil { + // See https://github.com/organicmaps/organicmaps/issues/6917 for the details. + if #available(iOS 13.0, *), previousTraitCollection == nil { scrollView.contentInset = alternativeSizeClass(iPhone: UIEdgeInsets(top: view.height, left: 0, bottom: 0, right: 0), iPad: UIEdgeInsets.zero) scrollView.layoutIfNeeded() @@ -84,6 +85,13 @@ final class PlacePageScrollView: UIScrollView { override func viewDidLayoutSubviews() { super.viewDidLayoutSubviews() + if #available(iOS 13.0, *) { + // See https://github.com/organicmaps/organicmaps/issues/6917 for the details. + } else if previousTraitCollection == nil { + scrollView.contentInset = alternativeSizeClass(iPhone: UIEdgeInsets(top: scrollView.height, left: 0, bottom: 0, right: 0), + iPad: UIEdgeInsets.zero) + updateSteps() + } panGesture.isEnabled = alternativeSizeClass(iPhone: false, iPad: true) previousTraitCollection = traitCollection }