Commit 18d26e8d authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Prevent FindBar from overlapping status bar

This CL adds a top constraints to the FindBar to avoid having it
overlapping the status bar when entering fullscreen.

Bug: 903802
Change-Id: I885c6eb8ca39a1810c1ce5c068d87ab01d68e22e
Reviewed-on: https://chromium-review.googlesource.com/c/1341912Reviewed-by: default avatarStepan Khapugin <stkhapugin@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609290}
parent e2fbae6a
......@@ -374,12 +374,22 @@ const NSTimeInterval kSearchShortDelay = 0.100;
[parentView addSubview:self.view];
self.view.accessibilityIdentifier = kFindInPageContainerViewId;
// Make sure that the Find in Page view bottom constraint has a lower priority
// than the constraint making sure that it doesn't overlap with the status
// bar.
NSLayoutConstraint* bottomConstraint =
[self.view.bottomAnchor constraintEqualToAnchor:toolbarView.bottomAnchor];
bottomConstraint.priority = UILayoutPriorityRequired - 1;
[NSLayoutConstraint activateConstraints:@[
[self.view.leadingAnchor constraintEqualToAnchor:parentView.leadingAnchor],
[self.view.trailingAnchor
constraintEqualToAnchor:parentView.trailingAnchor],
bottomConstraint,
[self.findBarView.topAnchor
constraintGreaterThanOrEqualToAnchor:self.view.safeAreaLayoutGuide
.topAnchor],
[self.view.topAnchor constraintEqualToAnchor:parentView.topAnchor],
[self.view.bottomAnchor constraintEqualToAnchor:toolbarView.bottomAnchor],
]];
CGFloat duration = animated ? kAnimationDuration : 0;
......
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