How to change color of CNContactPickerViewController searchBar

丶灬走出姿态 提交于 2019-12-21 09:19:18

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!