Chromium Code Reviews| Index: ios/chrome/browser/ui/ntp/new_tab_page_view.mm |
| diff --git a/ios/chrome/browser/ui/ntp/new_tab_page_view.mm b/ios/chrome/browser/ui/ntp/new_tab_page_view.mm |
| index 7f9f7ab87e63cfe169c902b229e1c613ae416218..0fedbd148d776c18cd0c33db4f04c12ddefd9a67 100644 |
| --- a/ios/chrome/browser/ui/ntp/new_tab_page_view.mm |
| +++ b/ios/chrome/browser/ui/ntp/new_tab_page_view.mm |
| @@ -80,11 +80,14 @@ |
| [self.scrollView setContentOffset:point animated:NO]; |
| } |
| - // Trigger a layout. The |-layoutIfNeeded| call is required because sometimes |
| - // |-layoutSubviews| is not successfully triggered when |-setNeedsLayout| is |
| - // called after frame changes due to autoresizing masks. |
| - [self setNeedsLayout]; |
| - [self layoutIfNeeded]; |
| + if (self.translatesAutoresizingMaskIntoConstraints) { |
|
marq (ping after 24h)
2017/04/05 12:22:47
It's not clear to my why this is conditional here.
justincohen
2017/04/05 19:28:23
Added a comment explaining why.
|
| + // Trigger a layout. The |-layoutIfNeeded| call is required because |
| + // sometimes |
| + // |-layoutSubviews| is not successfully triggered when |-setNeedsLayout| is |
| + // called after frame changes due to autoresizing masks. |
| + [self setNeedsLayout]; |
| + [self layoutIfNeeded]; |
| + } |
| } |
| - (void)layoutSubviews { |
| @@ -102,6 +105,10 @@ |
| CGRectGetMinX(self.bounds), CGRectGetMinY(self.bounds), |
| CGRectGetWidth(self.bounds), CGRectGetMinY(self.tabBar.frame)); |
| } |
| + |
| + if (!self.translatesAutoresizingMaskIntoConstraints) { |
| + [self setFrame:self.frame]; |
|
marq (ping after 24h)
2017/04/05 12:22:47
This feels deeply wrong. Why is it needed?
justincohen
2017/04/05 19:28:23
Added a comment explaining why.
|
| + } |
| } |
| - (void)updateScrollViewContentSize { |