Cursor invisible in UISearchBar iOS 7

后端 未结 6 929
攒了一身酷
攒了一身酷 2020-12-11 15:04

I have UISearchBar in UITableView as a table header. When I push the UISearchBar for start searching, this method is being triggered

6条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-11 15:53

    Your cursor is white because your tintColor property on UISearchBar is set to white.

    If you want Cancel btn to be white, but cursor to be black you can use: UITextField.appearance(whenContainedInInstancesOf: [UISearchBar.self]).tintColor = .black

提交回复
热议问题