The UISearchBar
in my UITableView
header is the strong color.
The TableSearch
uses the more subtle code, but I'm not sure how it's doing it. I've looked at the TableSearch example code. Specifically, I don't see tintColor
being used anywhere in this example. I don't see opacity or alpha used, either.
How does the TableSearch
example do this? Can anyone explain it?
According to the documentation, there is a tintColor
property on the UISearchBar
class.
In the TableSearch example the search bar is defined and loaded in the MainView.xib. If you want to change its tintColor or style, just do it in the xib and it will be loaded into the application.
You can set the UISearchBar to any color you like using:
self.mySearchBar.tintColor = [UIColor colorWithRed:153/255.0 green:102/255.0 blue:51/255.0 alpha:1.0];
In this example the first number in the fractions are the RGB values. Just find the RGB color you want and fill in the values here.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With