From d4cd46f8a381b85b35c50b075f18a016693a1a52 Mon Sep 17 00:00:00 2001 From: tianbin Date: Tue, 3 Jul 2018 13:58:05 +0800 Subject: [PATCH] fix nav titleColor mistake when use bar's titleTextAttributes after push/pop. --- .../xcshareddata/IDEWorkspaceChecks.plist | 8 ++++++++ .../UINavigationController+KMNavigationBarTransition.m | 1 + .../UIViewController+KMNavigationBarTransition.m | 1 + 3 files changed, 10 insertions(+) create mode 100644 KMNavigationBarTransition.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/KMNavigationBarTransition.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/KMNavigationBarTransition.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/KMNavigationBarTransition.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/KMNavigationBarTransition/UINavigationController+KMNavigationBarTransition.m b/KMNavigationBarTransition/UINavigationController+KMNavigationBarTransition.m index 9743056..a3a0b8a 100755 --- a/KMNavigationBarTransition/UINavigationController+KMNavigationBarTransition.m +++ b/KMNavigationBarTransition/UINavigationController+KMNavigationBarTransition.m @@ -94,6 +94,7 @@ - (UIViewController *)km_popViewControllerAnimated:(BOOL)animated { self.navigationBar.barTintColor = appearingNavigationBar.barTintColor; [self.navigationBar setBackgroundImage:[appearingNavigationBar backgroundImageForBarMetrics:UIBarMetricsDefault] forBarMetrics:UIBarMetricsDefault]; self.navigationBar.shadowImage = appearingNavigationBar.shadowImage; + [self.navigationBar setTitleTextAttributes:appearingNavigationBar.titleTextAttributes]; } if (animated) { disappearingViewController.navigationController.km_backgroundViewHidden = YES; diff --git a/KMNavigationBarTransition/UIViewController+KMNavigationBarTransition.m b/KMNavigationBarTransition/UIViewController+KMNavigationBarTransition.m index 3638125..4c6a326 100644 --- a/KMNavigationBarTransition/UIViewController+KMNavigationBarTransition.m +++ b/KMNavigationBarTransition/UIViewController+KMNavigationBarTransition.m @@ -135,6 +135,7 @@ - (void)km_addTransitionNavigationBarIfNeeded { bar.barTintColor = self.navigationController.navigationBar.barTintColor; [bar setBackgroundImage:[self.navigationController.navigationBar backgroundImageForBarMetrics:UIBarMetricsDefault] forBarMetrics:UIBarMetricsDefault]; bar.shadowImage = self.navigationController.navigationBar.shadowImage; + [bar setTitleTextAttributes:self.navigationController.navigationBar.titleTextAttributes]; [self.km_transitionNavigationBar removeFromSuperview]; self.km_transitionNavigationBar = bar; [self km_resizeTransitionNavigationBarFrame];