Cursor not displaying in UISearchBar for our app
Solution 1:
Our problem was that the tint color was set to white, so I didn't see it.
Solution 2:
Set
searchBar.tintColor = [UIColor blueColor];
Solution 3:
In the searchbox property window
open View Section>Set Tint color - default.
Hope this will help.
Solution 4:
This is how it can be done in Swift :
override func viewWillAppear(animated: Bool) {
self.searchBar.tintColor = UIColor.whiteColor()
let view: UIView = self.searchBar.subviews[0] as! UIView
let subViewsArray = view.subviews
for (subView: UIView) in subViewsArray as! [UIView] {
println(subView)
if subView.isKindOfClass(UITextField){
subView.tintColor = UIColor.blueColor()
}
}
}