I am having hassle customizing the nav button colours in PHPickerViewController when it’s proven with restricted picture library entry on iOS. The navigation bar buttons (“Cancel” and “Executed”) are showing in white on a white background, which makes them invisible. I need them to look in black for higher visibility.
What I’ve tried:
- Setting World UINavigationBar Look in AppDelegate:
UINavigationBar.look().tintColor = UIColor.black
let look = UINavigationBarAppearance()
look.configureWithOpaqueBackground()
look.backgroundColor = .white
look.titleTextAttributes = [.foregroundColor: UIColor.black]
look.buttonAppearance.regular.titleTextAttributes = [.foregroundColor: UIColor.black]
look.shadowColor = .clear
UINavigationBar.look().standardAppearance = look
UINavigationBar.look().scrollEdgeAppearance = look
- Customizing PHPickerViewController Instantly:
@objc func openPHPicker() {
if #obtainable(iOS 14.0, *) {
var configuration = PHPickerConfiguration()
configuration.selectionLimit = 4
configuration.filter = .photos
let picker = PHPickerViewController(configuration: configuration)
picker.navigationController?.navigationBar.tintColor = .black
picker.navigationController?.navigationBar.titleTextAttributes = [.foregroundColor: UIColor.black]
picker.delegate = self
self.current(picker, animated: true, completion: nil)
}
}
Regardless of making an attempt each approaches, the buttons nonetheless seem in white on the restricted entry library view. I’ve observed that different apps (like Instagram) handle to show these buttons in black, so I assume there have to be a solution to implement this styling, however I am unable to work out how.