【发布时间】:2021-10-21 03:32:48
【问题描述】:
我想更改CNContactPickerViewController 上导航栏显示的颜色。
我尝试了以下代码,但它不起作用。
let contactPicker = CNContactPickerViewController()
// let searchController = UISearchController()
contactPicker.delegate = self
contactPicker.modalPresentationStyle = .fullScreen
// UISearchBar.appearance().text = "SEARCH".localized
// contactPicker.navigationController?.isNavigationBarHidden = true
UINavigationBar.appearance().isTranslucent = false
UINavigationBar.appearance().barTintColor = .white
contactPicker.displayedPropertyKeys =
[CNContactPhoneNumbersKey, CNContactEmailAddressesKey]
contactPicker.predicateForEnablingContact = NSPredicate(format: "emailAddresses.@count > 0 || phoneNumbers.@count > 0")
present(contactPicker, animated: true)
【问题讨论】:
标签: ios swift uinavigationbar contacts