Commit a9df9ee9 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Ensure MDCAppBarViewController's view matches the width of...

[ios] Ensure MDCAppBarViewController's view matches the width of PaymentRequestPickerViewController's view.

Late addition to the docs: https://github.com/material-components/material-components-ios/tree/develop/components/AppBar#migration-guide-mdcappbar-to-mdcappbarviewcontroller

Bug: 874471
Change-Id: If17ea9de20fec0463e918aea4f401427c3572bc5
Reviewed-on: https://chromium-review.googlesource.com/1239008Reviewed-by: default avatarMoe Ahmadi <mahmadi@chromium.org>
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#594088}
parent 9abfcfa1
...@@ -138,6 +138,12 @@ NSString* const kPaymentRequestPickerSearchBarAccessibilityID = ...@@ -138,6 +138,12 @@ NSString* const kPaymentRequestPickerSearchBarAccessibilityID =
[self addChildViewController:self.appBarViewController]; [self addChildViewController:self.appBarViewController];
ConfigureAppBarViewControllerWithCardStyle(self.appBarViewController); ConfigureAppBarViewControllerWithCardStyle(self.appBarViewController);
self.appBarViewController.headerView.trackingScrollView = self.tableView; self.appBarViewController.headerView.trackingScrollView = self.tableView;
// Match the width of the parent view.
CGRect frame = self.appBarViewController.view.frame;
frame.origin.x = 0;
frame.size.width =
self.appBarViewController.parentViewController.view.bounds.size.width;
self.appBarViewController.view.frame = frame;
[self.view addSubview:self.appBarViewController.view]; [self.view addSubview:self.appBarViewController.view];
[self.appBarViewController didMoveToParentViewController:self]; [self.appBarViewController didMoveToParentViewController:self];
} }
......
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