Skip to content

Commit

Permalink
Fix toolbar position for pre-iOS 11 devices
Browse files Browse the repository at this point in the history
  • Loading branch information
oliveroneill committed Dec 3, 2017
1 parent 5e69d89 commit 6e42785
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Classes/IDMPhotoBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ - (CGRect)animationFrameForImage:(UIImage *)image presenting:(BOOL)presenting sc
if (@available(iOS 11.0, *)) {
// use the windows safe area inset
UIWindow *window = [UIApplication sharedApplication].keyWindow;
UIEdgeInsets insets = UIEdgeInsetsZero;
UIEdgeInsets insets = UIEdgeInsetsMake(_statusBarHeight, 0, 0, 0);
if (window != NULL) {
insets = window.safeAreaInsets;
}
Expand Down Expand Up @@ -1159,7 +1159,8 @@ - (CGRect)adjustForSafeArea:(CGRect)rect adjustForStatusBar:(BOOL)adjust {
if (@available(iOS 11.0, *)) {
return [self adjustForSafeArea:rect adjustForStatusBar:adjust forInsets:self.view.safeAreaInsets];
}
return rect;
UIEdgeInsets insets = UIEdgeInsetsMake(_statusBarHeight, 0, 0, 0);
return [self adjustForSafeArea:rect adjustForStatusBar:adjust forInsets:insets];
}

- (CGRect)adjustForSafeArea:(CGRect)rect adjustForStatusBar:(BOOL)adjust forInsets:(UIEdgeInsets) insets {
Expand Down

0 comments on commit 6e42785

Please sign in to comment.