iOS swift UISearchBar拿到textfield控件

版权声明:转载请标明出处 https://blog.csdn.net/ZY_FlyWay/article/details/81085332

目标:修改 UISearchBar textField 光标颜色 和 取消按钮颜色不一致。

searchBar.barTintColor = UIColor.clear
if let textfiled = searchBar.subviews.first?.subviews.last as? UITextField {
       textfiled.tintColor = UIColor.yellow
 }

猜你喜欢

转载自blog.csdn.net/ZY_FlyWay/article/details/81085332