Commit 5b7c5a3f authored by edchin's avatar edchin Committed by Commit Bot

[ios] Fix content inset behavior in recent tabs in tab grid

Previously, the section header in recent tabs in tab grid was a little
low, and content would scroll up behind the section header.

This CL fixes that by adjusting the content inset behavior so that the
section header is flush up against the top toolbar.

Bug: 852721
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I1ab1f2f926b41cc7c874fc8b2250163b90bc4615
Reviewed-on: https://chromium-review.googlesource.com/1102194Reviewed-by: default avataredchin <edchin@chromium.org>
Reviewed-by: default avatarMark Cogan <marq@chromium.org>
Commit-Queue: edchin <edchin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#567594}
parent 48a29efa
...@@ -456,11 +456,17 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) { ...@@ -456,11 +456,17 @@ NSUInteger GetPageIndexFromPage(TabGridPage page) {
self.remoteTabsViewController.styler = styler; self.remoteTabsViewController.styler = styler;
UIView* contentView = self.scrollContentView; UIView* contentView = self.scrollContentView;
UIViewController* viewController = self.remoteTabsViewController; RecentTabsTableViewController* viewController = self.remoteTabsViewController;
viewController.view.translatesAutoresizingMaskIntoConstraints = NO; viewController.view.translatesAutoresizingMaskIntoConstraints = NO;
[self addChildViewController:viewController]; [self addChildViewController:viewController];
[contentView addSubview:viewController.view]; [contentView addSubview:viewController.view];
[viewController didMoveToParentViewController:self]; [viewController didMoveToParentViewController:self];
if (@available(iOS 11, *)) {
// Adjustments are made in |-viewWillLayoutSubviews|. Automatic adjustments
// do not work well with the scrollview.
viewController.tableView.contentInsetAdjustmentBehavior =
UIScrollViewContentInsetAdjustmentNever;
}
NSArray* constraints = @[ NSArray* constraints = @[
[viewController.view.topAnchor [viewController.view.topAnchor
constraintEqualToAnchor:contentView.topAnchor], constraintEqualToAnchor:contentView.topAnchor],
......
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