问题
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.
回答1:
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)
来源:https://stackoverflow.com/questions/46162120/how-to-change-color-of-cncontactpickerviewcontroller-searchbar