diff --git a/clients/ios/Classes/DetailObjCViewController.m b/clients/ios/Classes/DetailObjCViewController.m index 44c5e5f38..90d98203b 100644 --- a/clients/ios/Classes/DetailObjCViewController.m +++ b/clients/ios/Classes/DetailObjCViewController.m @@ -592,6 +592,8 @@ self.currentlyTogglingNavigationBar = NO; [self updateStatusBarState]; }]; + + [self adjustForAutoscroll]; } - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer { @@ -690,6 +692,10 @@ @throw [NSException exceptionWithName:@"Missing -resetOtherStoryControllers implementation" reason:@"This is implemented in the Swift subclass, so should never reach here." userInfo:nil]; } +- (void)adjustForAutoscroll { + @throw [NSException exceptionWithName:@"Missing -adjustForAutoscroll: implementation" reason:@"This is implemented in the Swift subclass, so should never reach here." userInfo:nil]; +} + - (void)hidePages { [self resetOtherStoryControllers]; } diff --git a/clients/ios/Classes/DetailViewController.swift b/clients/ios/Classes/DetailViewController.swift index 015e9f982..a26fa175d 100644 --- a/clients/ios/Classes/DetailViewController.swift +++ b/clients/ios/Classes/DetailViewController.swift @@ -110,6 +110,9 @@ class DetailViewController: DetailObjCViewController { /// Bottom container view. @IBOutlet weak var bottomContainerView: UIView! + /// Top container view top constraint. May need to adjust this for fullscreen on iPhone. + @IBOutlet weak var topContainerTopConstraint: NSLayoutConstraint! + /// Bottom constraint of the divider view. @IBOutlet weak var dividerViewBottomConstraint: NSLayoutConstraint! @@ -207,6 +210,14 @@ class DetailViewController: DetailObjCViewController { appDelegate.feedsViewController.loadOfflineFeeds(false) } + @objc func adjustForAutoscroll() { + if UIDevice.current.userInterfaceIdiom == .phone, !isNavigationBarHidden { + topContainerTopConstraint.constant = -44 + } else { + topContainerTopConstraint.constant = 0 + } + } + override func viewDidLoad() { super.viewDidLoad() @@ -307,6 +318,8 @@ private extension DetailViewController { if horizontalPageViewController?.view.superview != appropriateSuperview { add(viewController: horizontalPageViewController, top: !isTop) + adjustForAutoscroll() + if isTop { bottomContainerView.addSubview(traverseView) bottomContainerView.addSubview(autoscrollView) diff --git a/clients/ios/Resources/MainInterface.storyboard b/clients/ios/Resources/MainInterface.storyboard index 7c9f15901..efd710985 100644 --- a/clients/ios/Resources/MainInterface.storyboard +++ b/clients/ios/Resources/MainInterface.storyboard @@ -13,7 +13,7 @@ - + @@ -366,6 +366,7 @@ +