Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Pod/Classes/MWPhotoBrowser.m
Original file line number Diff line number Diff line change
Expand Up @@ -1004,16 +1004,22 @@ - (CGPoint)contentOffsetForPageAtIndex:(NSUInteger)index {

- (CGRect)frameForToolbarAtOrientation:(UIInterfaceOrientation)orientation {
CGFloat height = 44;
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone &&
UIInterfaceOrientationIsLandscape(orientation)) height = 32;
return CGRectIntegral(CGRectMake(0, self.view.bounds.size.height - height, self.view.bounds.size.width, height));
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone && UIInterfaceOrientationIsLandscape(orientation)) height = 32;

CGFloat y = self.view.bounds.size.height - height;
if (@available(iOS 11.0, *)) y -= self.view.safeAreaInsets.bottom;

return CGRectIntegral(CGRectMake(0, y, self.view.bounds.size.width, height));
}

- (CGRect)frameForCaptionView:(MWCaptionView *)captionView atIndex:(NSUInteger)index {
CGRect pageFrame = [self frameForPageAtIndex:index];
CGSize captionSize = [captionView sizeThatFits:CGSizeMake(pageFrame.size.width, 0)];
CGFloat captionY = pageFrame.size.height - captionSize.height - (_toolbar.superview?_toolbar.frame.size.height:0);
if (@available(iOS 11.0, *)) captionY -= self.view.safeAreaInsets.bottom;

CGRect captionFrame = CGRectMake(pageFrame.origin.x,
pageFrame.size.height - captionSize.height - (_toolbar.superview?_toolbar.frame.size.height:0),
captionY,
pageFrame.size.width,
captionSize.height);
return CGRectIntegral(captionFrame);
Expand Down