2017-09-11 5 views
9

CNContactPickerViewControllerをViewControllerから開始しますが、その内部の検索バーのテキストカラーを変更するにはどうすればよいですか。ナビゲーションバーは濃い青色で、iOS11ではデフォルトのsearchbartextが黒です。CNContactPickerViewControllerの色を変更する方法searchBar

+0

の背景色を設定する必要がiOSの11が今出ているので、iOS11 – RBN

+0

のバグや新しい本ですが、私はこのことを考えますあなたのアプリの濃淡に応じて、iOS11で新しく追加されました。 – tmiedema

+1

検索バーのテキストの色を変更する方法が見つからなかったのですが、黒のままでしたが、代わりに背景色を変更できました。 [[UISearchBar appearance] setBackgroundColor:[UIColor whiteColor]]; –

答えて

1

私はあなたの存在CNContactPickerViewController前に迅速 に修正する方法を更新し、あなたはUISearchBar

  UISearchBar.appearance().backgroundColor = UIColor.white 
     let cancelButtonAttributes = [NSForegroundColorAttributeName: ColorConstant.baseColorGray] 
     UIBarButtonItem.appearance(whenContainedInInstancesOf: 
     [UISearchBar.self]).setTitleTextAttributes(cancelButtonAttributes, for: .normal) 
関連する問題