Commit a2a16802 by Rune Madsen

Merge pull request #62 from Shopify/runmad.fix-layout-margin-usage

Use bottom layout margins instead of calculating offset using views
parents f5c7af61 0172639a
......@@ -143,6 +143,8 @@ CGFloat const BUYMaxProductViewHeight = 640.0;
_productView.productViewHeader.collectionView.delegate = self;
_productView.productViewHeader.collectionView.dataSource = self;
_productView.layoutMargins = UIEdgeInsetsMake(self.productView.layoutMargins.top, self.productView.layoutMargins.left, self.bottomLayoutGuide.length, self.productView.layoutMargins.right);
}
return _productView;
}
......@@ -178,10 +180,6 @@ CGFloat const BUYMaxProductViewHeight = 640.0;
[super viewWillAppear:animated];
[self setupNavigationBarAppearance];
[self.navigationController setNavigationBarHidden:self.isLoading];
CGFloat bottomMargin = 0;
bottomMargin += self.tabBarController ? CGRectGetHeight(self.tabBarController.tabBar.bounds) : 0;
bottomMargin += self.navigationController.isToolbarHidden ? 0 : CGRectGetHeight(self.navigationController.toolbar.bounds);
_productView.layoutMargins = UIEdgeInsetsMake(self.productView.layoutMargins.top, self.productView.layoutMargins.left, bottomMargin, self.productView.layoutMargins.right);
}
- (void)viewDidLayoutSubviews
......
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