Commit a904f2a3 by Rune Madsen

Use layout guides for inset instead

parent d1dc5447
...@@ -460,9 +460,11 @@ CGFloat const BUYMaxProductViewHeight = 640.0; ...@@ -460,9 +460,11 @@ CGFloat const BUYMaxProductViewHeight = 640.0;
[(BUYNavigationController*)self.navigationController updateCloseButtonImageWithTintColor:YES duration:0]; [(BUYNavigationController*)self.navigationController updateCloseButtonImageWithTintColor:YES duration:0];
self.navigationBar.alpha = 1; self.navigationBar.alpha = 1;
self.navigationBarTitle.alpha = 1; self.navigationBarTitle.alpha = 1;
// When using 3D Touch, the initial height of the navigation bar (without UIStatusBar) doesn't match the final height (with UIStatusBar) CGFloat topInset = 0;
// so we're forced to set it manually in case it's not tall enough. Of course, this is only valid for products with no product images. if (self.presentingViewController) {
[self.productView setInsets:UIEdgeInsetsMake(MAX(CGRectGetHeight(self.navigationBar.bounds), 64), 0, 0, 0) appendToCurrentInset:YES]; topInset = CGRectGetHeight([[(UINavigationController*)self.presentingViewController navigationBar] bounds]) + self.presentingViewController.topLayoutGuide.length;
}
[self.productView setInsets:UIEdgeInsetsMake(topInset, 0, 0, 0) appendToCurrentInset:YES];
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment