Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Navigation Bar Bug #436

Merged
merged 3 commits into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Braintree iOS Drop-in SDK - Release Notes

## unreleased
* Fix bug where setting global navigation bar overrides the payment selection screen (fixes #435)
* Allow overriding navigation bar color and text via `BTDropInUICustomization.barBackgroundColor` and `BTDropInUICustomization.primaryTextColor`

## 9.10.0 (2023-09-06)
* Require `braintree_ios` 5.23.0
* Update to use macros to avoid compile time errors (fixes #421)
Expand Down
11 changes: 11 additions & 0 deletions Sources/BraintreeDropIn/BTPaymentSelectionViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,17 @@ - (void)viewDidLoad {
[titleLabel sizeToFit];
self.navigationItem.titleView = titleLabel;

self.navigationController.navigationBar.barTintColor = [BTUIKAppearance sharedInstance].barBackgroundColor;
self.navigationController.navigationBar.translucent = NO;
if (@available(iOS 15, *)) {
UINavigationBarAppearance *appearance = [[UINavigationBarAppearance alloc]init];
appearance.backgroundColor = [BTUIKAppearance sharedInstance].barBackgroundColor;

self.navigationController.navigationBar.standardAppearance = appearance;
self.navigationController.navigationBar.scrollEdgeAppearance = self.navigationController.navigationBar.standardAppearance;
}

[self.navigationController.navigationBar setTitleTextAttributes:@{ NSForegroundColorAttributeName: [BTUIKAppearance sharedInstance].primaryTextColor }];
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault]; // make nav bar clear
self.view.backgroundColor = UIColor.clearColor;

Expand Down
Loading