I start a CNContactPickerViewController from a viewcontroller, but how can I change the textcolor of the searchbar inside it. The navigationbar is dark blue, in iOS11 the default searchbartext is black.
How to change color of CNContactPickerViewController searchBar
Asked Answered
I updated the way to fix in swift Before you present CNContactPickerViewController, you should set background color of UISearchBar
UISearchBar.appearance().backgroundColor = UIColor.white
let cancelButtonAttributes = [NSForegroundColorAttributeName: ColorConstant.baseColorGray]
UIBarButtonItem.appearance(whenContainedInInstancesOf:
[UISearchBar.self]).setTitleTextAttributes(cancelButtonAttributes, for: .normal)
© 2022 - 2024 — McMap. All rights reserved.
[[UISearchBar appearance] setBackgroundColor:[UIColor whiteColor]];
. This bug is only present in iOS 11, @RBN. – Jehiah