From c6e5d4369b64b612e4c9387d8902f8be348567b5 Mon Sep 17 00:00:00 2001 From: Michael Kirk Date: Tue, 13 Feb 2018 18:46:07 -0800 Subject: [PATCH] Don't adjust inset when fully zoomed in. On iOS11, when looking at the full-screen media details, if you'd zoomed far enough that the media content is behind the status bar, tapping to hide the status bar would cause an undesirable change in content offset. // FREEBIE --- Signal/src/ViewControllers/MediaDetailViewController.m | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/MediaDetailViewController.m b/Signal/src/ViewControllers/MediaDetailViewController.m index c7603bb19..c84e9d1da 100644 --- a/Signal/src/ViewControllers/MediaDetailViewController.m +++ b/Signal/src/ViewControllers/MediaDetailViewController.m @@ -250,7 +250,12 @@ NS_ASSUME_NONNULL_BEGIN scrollView.showsVerticalScrollIndicator = NO; scrollView.showsHorizontalScrollIndicator = NO; scrollView.decelerationRate = UIScrollViewDecelerationRateFast; - self.automaticallyAdjustsScrollViewInsets = NO; + + if (@available(iOS 11.0, *)) { + scrollView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; + } else { + self.automaticallyAdjustsScrollViewInsets = NO; + } [scrollView autoPinToSuperviewEdges];