Closed y-okudera closed 4 years ago
Hi, @andreamazz Thank you for the cool library.
After hiding the navigation bar, the back button text color changed from transparent to black. And I solved the problem.
Updating the navigation appearance in sample app is the following.
extension UINavigationController { func setupCustomNavigation() { let clear = [NSAttributedString.Key.foregroundColor: UIColor.clear] if #available(iOS 13.0, *) { let barAppearance = UINavigationBarAppearance() // Hide back button title. let barButtonAppearance = UIBarButtonItemAppearance() barButtonAppearance.normal.titleTextAttributes = clear barButtonAppearance.highlighted.titleTextAttributes = clear barAppearance.backButtonAppearance = barButtonAppearance // Set NavigationBar background color. barAppearance.backgroundColor = .yellow self.navigationBar.standardAppearance = barAppearance self.navigationBar.isTranslucent = false } else { // Hide back button title. UIBarButtonItem .appearance(whenContainedInInstancesOf: [UINavigationBar.self]) .setTitleTextAttributes(clear, for: .normal) UIBarButtonItem .appearance(whenContainedInInstancesOf: [UINavigationBar.self]) .setTitleTextAttributes(clear, for: .highlighted) // Set NavigationBar background color. self.navigationBar.barTintColor = .yellow self.navigationBar.isTranslucent = false } } }
Best regards,
This issue also occurs on non-iOS 13, so I updated the title.
Nice catch, thanks for your contribution!
Hi, @andreamazz Thank you for the cool library.
After hiding the navigation bar, the back button text color changed from transparent to black. And I solved the problem.
Updating the navigation appearance in sample app is the following.
Best regards,